We measure the temporal pair correlation function g(2)(τ) of a trapped gas of bosons above and below the critical temperature for Bose-Einstein condensation. The measurement is performed in situ by using a local, time-resolved single-atom sensitive probing technique. Third- and fourth-order correlation functions are also extracted. We develop a theoretical model and compare it with our experimental data, finding good quantitative agreement. We discuss, finally, the role of interactions. Our results promote temporal correlations as new observables to study the dynamical evolution of ultracold quantum gases.