The energy levels of an atom can be determined by measuring the light emitted from an atom through a process called spectroscopy. When an atom is excited, it absorbs energy and its electrons move to higher energy levels. As the electrons fall back to lower energy levels, they release energy in the form of light. The frequency and wavelength of the emitted light are related to the energy difference between the electron's initial and final energy levels. By analyzing the spectrum of the emitted light, scientists can determine the energy levels of the atom and the transitions that occur between them.