You asked a complex question concerning specific energy levels in a solid state material. To answer this question we can say:
-When electrons move in vacuum it can assume continuous values of momentum and energy. They move like a classical particle.
- When the electrons move in a limited space like their movement in atoms , molecules,and solid materials they move as waves and their motion is no longer described by the classical newton laws. Their motion will be governed by the schroedinger wave equation. The solution of the schroedinger wave equation results in the quantization of momentum and energy of the electrons inside the atoms and the solid state material. This means that every electron inside an atom or a solid material has its own quantum values.
In case of atoms the electrons has discrete energy levels as the Bohr model for the hydrogen atom.
In case of crystalline solid material energy bands will be formed instead of discrete level for single isolated atom. This is because of the energy level splitting upon densifying the material by reducing the inter atomic distance and increasing the interaction between the atoms.
In metals the upermost energy band , the valence band,is partially filled with electrons or it overlaps with the adjacent higher empty band called the conduction band.
In semiconductors the valence band occupied by the valance electrons is nearly filled.
The higher band, the coduction band is separated by an energy gap from the valence band and is nearly empty at room temperature.
The occupation of an energy level is determined by Fermi- Dirac function. The fermi level is that level with an occupation probability of one half. As said before it lies inside the conduction band in metals and in the energy gap in semiconductors.
In order to transfer any electron from a lower filled level to a higher empty one must supply the electron by the energy difference between the two level and vice verse.
This energy may be thermal by heating, may be optical photons or any other radiation.
Contact difference of potential between two materials is governed by the work function. Thermionic and opto electronic emission is controlled by the work function also.
I hope i covered some aspects of the energy levels electrons in materials.