  To constrain for the first time the mean mass and extent of the molecular gas
of a mass-complete sample of $>10^{10}$M$_{\odot}$ main-sequence (MS) galaxies
at $0.4<z<3.6$. We apply an innovative $uv$-based stacking analysis to a large
set of archival Atacama Large Millimeter/submillimeter Array (ALMA)
observations. This stacking analysis provides measurements of the mean mass and
extent of the molecular gas of galaxy populations. The molecular gas mass of MS
galaxies evolves with redshift and stellar mass. At all stellar masses, the
molecular gas fraction decreases by a factor of 24 from $z\sim3.2$ to $z\sim0$.
At a given redshift, the molecular gas fraction of MS galaxies decreases with
stellar mass, at roughly the same rate as their specific star formation rate
decreases. The molecular gas depletion time of MS galaxies remains roughly
constant at $z>0.5$ with a value of 300--500 Myr, but increases by a factor of
3 from $z\sim0.5$ to $z\sim0$. This evolution of the molecular gas depletion
time of MS galaxies can be predicted from the evolution of their molecular gas
surface density and a seemingly universal MS-only $\Sigma_{M_{\rm
mol}}-\Sigma_{\rm SFR}$ relation with an inferred slope of 1.13, i.e., the
so-called KS relation. The far-infrared size of MS galaxies shows no
significant evolution with redshift or stellar mass, with a mean circularized
half-light radius of 2.2 kpc. Finally, our mean molecular gas masses are lower
than previous estimates, likely caused by the fact that literature studies were
biased towards individually-detected MS galaxies with massive gas reservoirs.
To first order, the molecular gas content of MS galaxies regulates their star
formation across cosmic time, while variation of their star formation
efficiency plays a secondary role. Despite a large evolution of their gas
content and SFRs, MS galaxies evolved along a seemingly universal MS-only KS
relation.
