(Abridged summary) Responding to ESAs Voyage 2050 call to define the long-term plan for the future space missions that will address the astrophysics science questions during the 2035-2050 cycle, we propose a dedicated, ultra-deep spectroscopic survey in the near infrared (NIR), that will target a mass-limited sample of galaxies during two of the most fundamental epochs of cosmic evolution: the formation of the first galaxies (at z>6; cosmic dawn), and at the peak of galaxy formation activity (between redshift z=1 and 3; cosmic noon). By way of NIR observations, it is possible to study the Lyman-alpha region in the former, and the optical rest-frame in the latter, allowing us to extract fundamental observables such as gas and stellar kinematics, chemical abundances, and ages, providing a unique legacy database covering these two crucial stages of cosmic evolution. A dedicated, space-based facility will overcome the challenges faced by ground-based telescopes, no matter how large the aperture, or the reduced field of view and low multiplex factor of the best space-based instrument in the near future, namely NIRSpec at the JWST. Our project (codename Chronos) aims to produce about 1 million high quality spectra, with a high S/N in the continuum, where information about the underlying stellar populations is encoded.