the energy levels of an electron may change when the atom emits or absorbs electromagnetic radiation:
absorbing electromagnetic radiation moves electrons to a higher energy level, further from the nucleus
electromagnetic radiation is emitted when an electron drops to a lower energy level