It is usually assumed that the quantum step (QS), quantum well (QW) and quantum barrier (QB) have the rectangular potential profiles. We show that the potential profiles are not really rectangular. A QS is actually a smooth, gradual change of potential over a distance larger than one monolayer. For a narrow QW, instead of the QW, a more appropriate term is the quantum valley. We study the dipole layers formed by the ions and calculate the electrostatic contribution to the potential. Notably, the minimal thickness of the QS is not determined by the distance between the charged planes, but by the lateral spacing between ions of the same polarity. In the example of GaN, the QS cannot be thinner than about 3 Å.