Solving the Schrödinger equation gives a wave function for each electron in an atom of any element. The wave functions under the atom can be squared to yield probability distribution maps, or orbitals, for electrons in that atom.
Since an electron moves around the nucleus, it possesses at least kinetic energy, gravitational potential energy, and electrical potential energy. When we talk about the energy of the electron, we usually mean the sum of all forms of its energy.
According to the quantum-mechanical model of atoms, each electron orbital falls under a shell, which has a very clearly defined energy value. For example, the $2s$, $2p_x$, $2p_y$, and $2p_z$ orbitals are all deemed to possess the energy value at $n = 2$. When an electron is assigned to an orbital, does it possess exactly the same amount of energy as the orbital's shell?
My intuitive answer is no, since an orbital covers a sizable portion of atomic space. An electron cannot possess exactly the same total energy at any position within this orbital space. But if an electron can possess more or less total energy than its orbital's shell depending on its position, what rule determines that it must belong to the orbital in question, instead of an orbital with lower or higher shell energy?