Computing an accurate estimate of the Fourier transform of a continuum-time signal from a discrete set of data points is crucially important in many areas of science and engineering. The conventional approach of performing the discrete Fourier transform of the data has the shortcoming of assuming periodicity and discreteness of the signal. In this paper, we show that it is possible to use Gaussian process regression for estimating any arbitrary integral transform without making these assumptions. This is possible because the posterior expectation of Gaussian process regression maps a finite set of samples to a function defined on the whole real line. In order to accurately extrapolate, we need to learn the covariance function from the data using an appropriately designed hierarchical Bayesian model. Our simulations show that the new method, when applied to the Fourier transform, leads to sharper and more precise estimation of the spectral density of deterministic and stochastic signals.