The region where the potential changes is known as the depletion region and is typically on the order of 10 micrometers. The change in the potential causes and electric field directed from the n-type side to the p-type side. This will then push any stray holes in the n-type side to the p-type side and electrons from p-type to n-type.
The Fermi Energy is the same across the junction while still being near the valance band on the p type side and near the conduction band on the n-type side as a consequence of the energy level shifting due to the potential. This only applies when the system is in dynamical equilibrium and so when no external potential difference is applied. The state of equilibrium implies that the current of electrons and holes diffusing from the p side to the n side is equal to the diffusion current from the n side to the p side, so that no resultant current flows.