The thickness of absorbing layer is dictated by the absorption coefficient of the longest wavelength of the absorbed solar radiation. As a rule of thumb the thickness d >= 1/alpha where alpha is the absorption coefficient of the longest absorbed wavelength. Thin film solar cells are characterized by direct gap absorbing materials whose absorption coefficient alpha is very high.
As an example of such materials are the organic and the perovskite solar cells.
There is also the amorphous silicon solar cell materials and the ternary compounds Copper Zinc Tin Sulfide-Based Thin-Film Solar Cells.
If the collection process is in the direction of the incident solar radiation, then the thickness must satisfy also an other condition. The thickness d
Barzinjy, A., Esmaeel, M., Aydin, S., Hussain, F. and Hamad, S., 2020. Biosynthesis and Characterization of Zinc Oxide Nanoparticles from Punica Granatum (Pomegranate) Juice extract and its Application in Thin Films Preparation by Spin-Coating Method. Micro & Nano Letters.
The absorber should be electrical thin yet optical thick. So, if you can estimate the diffusion length / lifetime of your minority charge carriers, you could use this length as the maximum thickness for your thin film.
Light trapping techniques may enable you to go to even thinner absorbing layers, but only when the photonic approach does not deteriorate the carrier lifetimes.
I don't know whether you asking about physical principle or detailed computational method ... Other fellows have already provided good answers with some references for the details.
So, the basic principle is:
(1) You want to thick absorber layer so that it can maximize the absorption of photons. If your material is not efficient in photon absorption (such as silicon), then the layer needs to be thicker.
(2) On the other hand, the photon-generated electrons and holes need to be collected by the external contact. So, if the layer is too thick, then there is more risk that those carriers would be trapped or recombined and thus the device becomes less efficient.
This is why we care about optical absorption spectra of material, carrier lifetime, and thin-film growth with reduced defects etc ...