In experiments on molecular ions it is highly beneficial if the ions are in the electronic, vibrational and rotational ground state. Previous studies on these systems in ion traps or storage rings have been successful in preparing the molecular ions in the electronic and vibrational ground states, but the rotational degrees of freedom are experimentally more challenging due to their long relaxation times and the relatively small amounts of energy required for rotational excitations. Recent developments in electrostatic cryogenic storage devices have opened up possibilities of studying and controlling the rotational relaxation of molecular ions. This thesis presents experiments performed on the molecular ions OH¯ and OD¯ stored in the cryogenic storage ring DESIREE at Stockholm University. The molecular ions are studied using a technique known as photodetachment thermometry, relying on detection of molecules neutralized through photodetachment as they are stored in the ring. By modeling the photodetachment cross section, we are able to measure the relative populations of rotational states and monitor the rotational relaxation of the molecular ions. The long storage times of DESIREE allow us to observe the rotational relaxation on timescales up to several relaxation lifetimes. From these measurements we are able to extract the intrinsic lifetime of the first excited rotational state of OH¯ to be 183 ± 35 s. In addition to measuring the spontaneous rotational relaxation, we have also applied a selective photodetachment method to prepare an ensemble of ions at even lower internal temperature than what occurs spontaneously.