When a P type material and a N type material are brought in contact with each other, some of the holes in the P material migrate to the N region and combine with electrons. Similarly, some of the electrons of N material migrate to the P region and combine with holes.
Thus, at the point of contact of the P and N materials, a layer is formed which has no majority charge carriers such as holes or electrons. This region is called the depletion region as the region has been depleted of its charge carriers.
The depletion region behaves almost like an insulator. When a voltage exceeding the barrier potential is applied across the PN junction, current starts to flow.