Earths volatile elements (H, C, and N) are essential to maintaining habitable conditions for metazoans and simpler life forms. However, identifying the sources (comets, meteorites, and trapped nebular gas) that supplied volatiles to Earth is not straightforward because secondary processes like mantle degassing, crustal recycling, and escape to space modified the composition of the atmosphere. Here, we review two complementary approaches to investigate the origin of Earths atmosphere and oceans. The geochemical approach uses volatile element abundances and isotopic compositions to identify the possible contributors to the atmosphere and to disentangle the processes that shaped it. In that respect, noble gases (He, Ne, Ar, Kr, and Xe), elements that are chemically inert and possess several isotopes produced by radioactivity, play a critical role. The dynamical approach uses our knowledge of planetary dynamics to track volatile delivery to the Earth, starting with dust transport in the disk to planet-building processes. The main conclusion is that Earth acquired most of its major volatile elements by accretion of planetesimals or embryos akin to volatile-rich meteorites. At the same time, solar/meteoritic noble gases were captured by embryos and some gases were lost to space, by hydrodynamic escape and large impacts. Comets did not contribute much H, C, and N but may have delivered significant noble gases, which could represent the only fingerprints of the bombardment of our planet with icy bodies. The processes that governed the delivery of volatile elements to the Earth are thought to be relatively common and it is likely that Earth-like planets covered with oceans exist in extra-solar systems.