I should expand on this a bit .....
Don't get too tied up with the image you posted earlier .... the idea of electrons orbiting the atom nucleus like planets orbiting the sun or satellites orbiting the earth
is very outdated and not really correct. Electrons are in specific energy level positions around the nucleus of an atom in a "cloud" structure. The
Heisenberg Uncertainty Principle tells us that we don't know the exact locations of any of the electrons at any given time.
If you energize atoms, say by putting a voltage across the ends of a wire, you can move its electrons to higher energy state. A photon is produced whenever an electron in a higher-than-normal energy state(level) falls back to its normal energy level. During the fall from high energy to normal energy, the electron emits a photon -- a packet of energy -- with very specific characteristics. The photon has a frequency and colour, that exactly matches the distance the electron falls and how much energy the electron looses in that process. Photons are also emitted from a wire etc when electrons are accelerated eg by the application of an alternating voltage to the circuit. First the electrons are accelerated in in one direction ( one half of the cycle) the get accelerated in the other direction, in a repeating cycle.
This is one way to produce photons, there are several others that include bombarding an atom with
other particles ... like in an X-ray tube where a metal target is hit with a stream of high energy electrons. This causes hi energy photons to be emitted by the electrons in the target metal
Gamma radiation ( still photons, just higher energy and shorter wavelength) is usually produced when the nucleus of the atom emits photons when bombarded with hi energy electrons.
It's a difficult differentiation as X-rays can also be produced by this method, so measuring the
frequency/wavelength and the energy level of the photons being produced
So, each photon is a little packet of energy. It is NOT like a little bullet shooting out as old physics text books and still some high schools teach.
Once university physics education is started, the true properties of the photon are taught.
Light and other electromagnetic radiation is neither a wave nor a particle. Depending on the experiment used, it can be seen to be one or the other at that time
cheers
Dave