Neutral atomic hydrogen (HI) and molecular hydrogen (H2) play a primordial role in the cosmic evolution of galaxies. However, little is known about the co-evolution of these two gas phases. This discrepancy and the design of future telescopes like the SKA and ALMA require theoretical models of the joint evolution of HI and H2 in galaxies. This thesis starts with a phenomenological analysis of the H2/HI-ratios in a sample of 245 local galaxies. This analysis reveals a number of correlations between H2/HI-ratios and other galaxy properties, and we demonstrate that these correlations can be understood in terms of the microscopic relation between the H2/HI-ratio and the external gas pressure. We subsequently use this relation to derive an analytic model for the column densities of HI and H2 in arbitrary regular galaxies. As a second step, we apply the model for the column densities of HI and H2 to post-process approximately 3*10^7 virtual galaxies, whose cosmic evolution was simulated on the evolving dark matter skeleton output by the Millennium Simulation. The post-processing of these galaxies allows us to (i) split their total cold gas masses between HI, H2, and Helium, (ii) to assign realistic sizes to both the HI and H2-disks, and (iii) to evaluate the velocity profiles of HI and H2. The resulting hydrogen simulation successfully reproduces many local observations of HI and H2, such as mass functions (MFs), mass-diameter relations, and mass-velocity relations. A key prediction of this simulation is that the H2/HI-ratio of regular galaxies increases dramatically with redshift z, leading to a scaling of (1+z)^1.6 for the ratio between the cosmic space densities of H2 and HI. This prediction offers a unified explanation for (i) the weak evolution of the cosmic HI-density inferred from Lyman-alpha absorption against quasars, (ii) the large molecular masses detected in regular galaxies at z=1.5, and (iii) the recent cosmic decline in the density of star formation. As a third step, we introduce a heuristic model for the conversion of H2-masses into observable CO-line luminosities for galaxies at all redshifts. We apply this model to our hydrogen simulation in order to predict the luminosity functions of the first 10 rotational transitions of CO in galaxies at redshift z=0 to z=10. As a final step, we transform the simulated catalog of 3*10^7 evolving galaxies into a virtual observing cone, i.e. a catalog that lists the apparent HI and CO-line fluxes and corresponding line widths of millions of galaxies in a sky field with a comoving diameter of 500 Mpc/h. This catalog represents a tangible contribution towards the design and operation of future telescopes, such as the SKA and ALMA.