Answer:
The electrons in an atom can only occupy certain allowed energy levels to a lower one, the excess energy is emitted as a photon of light, with its wavelength dependent on the change in electron energy. This is why an atom can only emit specific wavelengths of light and not every possible wavelength.