High-power and widely tunable continuous-wave optical parametric oscillators (cw OPOs), as mature radiation sources in the mid-infrared range, are limited by their frequency fluctuation. We built a cw OPO working at the near- and mid-infrared ranges and discuss the extent to which its frequency stability is affected by the mechanical temperature and the air pressure of the cavity. In addition, we artificially provoked mode hops by changing the above two factors to analyze the thermal-induced refractive index variation of the crystal. An inequality between the spacing of the hops and the free spectrum range (FSR) was observed. The wavelength stability of the cw OPO was guaranteed passively, and the longest mode-hopping-free time exceeded 13 h through sealing the cavity and thermal control. Further analysis of factors affecting frequency drift is critically essential for the reliability of cw OPO, particularly in environments outside the laboratory, and may provide a new method for high-precision tuning wavelengths.