How it works:
First you make very fast electrons. You aim them at a heavy element. First off, sometimes the fast electrons will knock an inner electron from an atom out of position. Both electrons will leave. Some random electron will replace the inner electron, and in the process will release a fixed quantum of radiation. This will not be gamma radiation unless the atom is one where the drop to an inner electron gives gamma rays. Someone probably knows whether that can happen with any known elements but I don't. The K shell of tungsten gives x-rays, and I will guess that the others won't be a whole lot more energetic.
But these interactions with other electrons are only a fraction of the X-rays produced. More of it comes from interactions with the nucleus.
Here's a quick rundown of radiation in general. Radiation happens when a charge is accelerated.
Slow acceleration makes weak radiation. We detect radiation only when its effect on atoms is detectable, and the radiation from slow acceleration is not easy to detect! It's easiest when many charges are accelerated together, at a frequency that some arrangement of atoms is particularly ready to be affected by. So a radio tower accelerates a lot of elections linearly together in a sine wave, and radio receivers can detect that if they are tuned to the right frequency.
Fast acceleration can produce strong radiation which has big effects without needing a periodic wave. It can be aperiodic and still get observed. And that's mostly what X-ray tubes produce. A fast-moving electron which gets close to a nucleus will bend around it, that's acceleration. A short pulse. How much energy in the pulse? It depends on how close it got. Wavelength? Frequency? That doesn't mean much in this context.
wave from radio tower
wave from X-ray machine
In theory you could get radiation as high-energy as you want, by increasing the voltage. But most of the radiation would be x-ray or lower energy. See the Increasing the Tube Potential (kV) graph in this link.
You would run into physical problems with heat, durability of the various materials, etc. Something like 99% of the energy comes out as heat, and your tungsten or molybdenum anode will eventually melt. Or little bits will vaporize and get deposited elsewhere. There could be other problems too, but I expect if you tried you might create a device which could get a small fraction of gamma rays for a short time.