After hydrogen and helium, oxygen, carbon, and nitrogen—hereinafter, the CNO elements—are the most abundant species in the universe. They are observed in all kinds of astrophysical environments, from the smallest to the largest scales, and are at the basis of all known forms of life, hence, the constituents of any biomarker. As such, their study proves crucial in several areas of contemporary astrophysics, extending to astrobiology. In this review, I will summarize current knowledge about CNO element evolution in galaxies, starting from our home, the Milky Way. After a brief recap of CNO synthesis in stars, I will present the comparison between chemical evolution model predictions and observations of CNO isotopic abundances and abundance ratios in stars and in the gaseous matter. Such a comparison permits to constrain the modes and time scales of the assembly of galaxies and their stellar populations, as well as stellar evolution and nucleosynthesis theories. I will stress that chemical evolution models must be carefully calibrated against the wealth of abundance data available for the Milky Way before they can be applied to the interpretation of observational datasets for other systems. In this vein, I will also discuss the usefulness of some key CNO isotopic ratios as probes of the prevailing, galaxy-wide stellar initial mass function in galaxies where more direct estimates from the starlight are unfeasible.