Coherence, the stability of the relative phase between quantum states, is central to quantum mechanics and its applications. For ultracold dipolar molecules at sub-microkelvin temperatures, internal states with robust coherence are predicted to offer rich prospects for quantum many-body physics and quantum information processing. We report the observation of stable coherence between nuclear spin states of ultracold fermionic sodium-potassium (NaK) molecules in the singlet rovibrational ground state. Ramsey spectroscopy reveals coherence times on the scale of 1 second; this enables high-resolution spectroscopy of the molecular gas. Collisional shifts are shown to be absent down to the 100-millihertz level. This work opens the door to the use of molecules as a versatile quantum memory and for precision measurements on dipolar quantum matter.