When an electron is hit by a photon of light, it absorbs the quanta of energy the photon was carrying and moves to a higher energy state.
One way of thinking about this higher energy state is to imagine that the electron is now moving faster, (it has just been "hit" by a rapidly moving photon). But if the velocity of the electron is now greater, it's wavelength must also have changed, so it can no long stay in the original orbital where the original wavelength was perfect for that orbital-shape.
So the electron moves to a different orbital where once again its own wavelength is in phase with its self.
Electrons therefore have to jump around within the atom as they either gain or lose energy. This property of electrons, and the energy they absorb or give off, can be put to an every day use.