The important thing to note here is that, because the only orbits allowed for the electron are the permitted orbits, the photon must have just the right energy to bump the electron up one or more energy levels. The higher the electron is bumped, the more energy it takes. The atom will not exist long in the excited state. When the atom relaxes to the ground state, energy is released in the form of a photon . That photon s energy is the same that would have been required to raise the electron up from the ground state to the level where it was.
Different elements have different permitted orbits .
So the intervals between the permitted orbits are different for each element, so when atoms of different elements relax from exited to ground state, they give off different wavelengths of light. So, when a light is behind or next to some thin gas, characteristic emission and absorption lines can be seen, due to the light exciting some atoms, and then those atoms relaxing back to ground state and giving off photons. Black body radiation is another kind of emission that occurs from a hot dense object. Every object emits some black body radiation, except for those at 0 degrees Kelvin. You experience this in an electric range.