A formalism to calculate the dipolar local field in homogeneously magnetized quasi-two-dimensional (Q2D) crystals is comprehensively presented. Two fundamental tests for this formalism are accomplished: the transition from the Q2D quantities to the corresponding 3D ones; and the recovering of the macroscopic quantities of the 3D continuum theory. The additive separation between lattice and shape contributions to the local field allows an unambiguous interpretation of the respective effects. Calculated demagnetization tensors for square and circular lateral geometries of dipole layers show that for a single crystal layer an extremely thin film, but still with a finite thickness, is a better physical representation than a strictly 2D plane. Distinct close-packed structures are simulated and calculations of the local field at the nodes of the stacked 2D lattices allow one to establish the number of significantly coupled dipole layers, depending on the ratio between the interlayer distance and the 2D lattice constant. The conclusions drawn are of interest for the study of the dipolar interaction in magnetic ultrathin films and other nanostructured materials, where magnetic nanoparticles are embedded in non-magnetic matrices.