The invention discloses an atomic magnetometer detection light frequency measuring and stabilizing device and method based on second harmonic. According t the method, based on the optical absorption effect and dispersion effect of an alkali metal atom gas chamber for detection laser and optical effects (such as an electro-optic effect, a magneto-optical effect, and a photoelastic effect) of a phase modulator, through monitoring a second harmonic signal outputted by an atomic magnetometer optical detection system, the detection light frequency is calculated in real time, with a servo controller and a closed-loop control algorithm, a control signal is fed to a detection light source control module to carry out corresponding adjustment, and the frequency online measurement of large detuning detection light and long time closed loop stability are realized. According to the device and the method, the advantages of system simplification, a small size, application range enlargement, real-time measurement and feedback are developed, the improvement of the sensitivity and stability of a miniaturized and integrated atomic magnetic field measurement device is facilitated, and the device and the method can be used for the industrial integration and practical application of a quantum sensing instrument such as an atomic magnetometer in the future.