The ability to characterize static and time-dependent electric fields in situ is an important prerequisite for quantum-optics experiments with atoms close to surfaces. Especially in experiments which aim at coupling Rydberg atoms to the near field of superconducting circuits, the identification and subsequent elimination of sources of stray fields is crucial. We present a technique that allows the determination of stray-electric-field distributions $(F^text{str}_text{x}(vec{r}),F^text{str}_text{y}(vec{r}),F^text{str}_text{z}(vec{r}))$ at distances of less than $2~text{mm}$ from (cryogenic) surfaces using coherent Rydberg-Stark spectroscopy in a pulsed supersonic beam of metastable $1text{s}^12text{s}^1~{}^{1}S_{0}$ helium atoms. We demonstrate the capabilities of this technique by characterizing the electric stray field emanating from a structured superconducting surface. Exploiting coherent population transfer with microwave radiation from a coplanar waveguide, the same technique allows the characterization of the microwave-field distribution above the surface.