We derive an analytical theory of the PDF of density fluctuations in supersonic turbulence in the presence of gravity in star-forming clouds. The theory is based on a rigorous derivation of a combination of the Navier-Stokes continuity equations for the fluid motions and the Poisson equation for the gravity. It extends upon previous approaches first by including gravity, second by considering the PDF as a dynamical system, not a stationary one. We derive the transport equations of the density PDF, characterize its evolution and determine the density threshold above which gravity strongly affects and eventually dominates the dynamics of turbulence. We demonstrate the occurence of {it two} power law tails in the PDF, with two characteristic exponents, corresponding to two different stages in the balance between turbulence and gravity. Another important result of this study is to provide a procedure to relate the observed {it column density} PDFs to the corresponding {it volume density} PDFs. This allows to infer, from the observation of column-densities, various physical parameters characterizing molecular clouds, notably the virial parameter. Furthermore, the theory offers the possibility to date the clouds in units of ${t}_{rm coll}$, the time since a statistically significant fraction of the cloud started to collapse. The theoretical results and diagnostics reproduce very well numerical simulations and observations of star-forming clouds. The theory provides a sound theoretical foundation and quantitative diagnostics to analyze observations or numerical simulations of star-forming regions and to characterize the evolution of the density PDF in various regions of molecular clouds.