The dielectric properties of thin films are of paramount importance in a variety of technological applications, and of fundamental importance for solid-state research. In spite of this, there is currently no theoretical understanding of the dependence of the dielectric permittivity on the thickness of thin films. We develop a confinement model within the Lorentz-field framework for the microscopic Langevin-equation description of dielectric response in terms of the atomic-scale vibrational modes of the solid. Based on this, we derive analytical expressions for the dielectric permittivity as a function of thin-film thickness, in excellent agreement with the experimental data of barium-strontium-titanate thin films of different stoichiometry. The theory shows that the decrease of dielectric permittivity with decreasing thickness is directly caused by the restriction in $k$ space of the available eigenmodes for the field-induced alignment of ions and charged groups.