In an atom, the electrons are at different levels of energy. The electrons of the lower energy levels are closer to the nucleus; those at higher energy levels are further from the nucleus.
The figure below shows an atom whose electrons are at different energy levels. In order for the level 1 electron to move to level 2, we must provide some energy to it, since the nucleus exerts an attractive force on this electron.
Thus, at level 2, the electron is at a higher energy level than when it occupied level 1.