We present a new open-loop implementation of Kelvin probe force microscopy (KPFM) that provides access to the Fourier spectrum of the time-periodic surface electrostatic potential generated under optical (or electrical) pumping with an atomic force microscope. The modulus and phase coefficients are probed by exploiting a double heterodyne frequency mixing effect between the mechanical oscillation of the cantilever, modulated components of the time-periodic electrostatic potential at harmonic frequencies of the pump, and an ac bias modulation signal. Each harmonic can be selectively transferred to the second cantilever eigenmode. We show how phase coherent sideband generation and signal demodulation at the second eigenmode can be achieved by using two numerical lock-in amplifiers configured in cascade. Dual-heterodyne KPFM (DHe-KPFM) can be used to map any harmonic (amplitude/phase) of the time-periodic surface potential at a standard scanning speed. The Fourier spectrum (series of harmonics) can also be recorded in spectroscopic mode (DHe-KPFM spectroscopy), and 2D dynamic images can be acquired in data cube mode. The capabilities of DHe-KPFM in terms of time-resolved measurements, surface photovoltage (SPV) imaging, and detection of weak SPV signals are demonstrated through a series of experiments on difference surfaces: a reference substrate, a bulk organic photovoltaic heterojunction thin film, and an optoelectronic interface obtained by depositing caesium lead bromide perovskite nanosheets on a graphite surface. The conclusion provides perspectives for future improvements and applications.