Many natural and industrial turbulent flows are subjected to time-dependent boundary conditions. Despite being ubiquitous, the influence of temporal modulations (with frequency f) on global transport properties has hardly been studied. Here, we perform numerical simulations of Rayleigh-Bénard convection with time periodic modulation in the temperature boundary condition and report how this modulation can lead to a significant heat flux (Nusselt number Nu) enhancement. Using the concept of Stokes thermal boundary layer, we can explain the onset frequency of the Nu enhancement and the optimal frequency at which Nu is maximal, and how they depend on the Rayleigh number Ra and Prandtl number Pr. From this, we construct a phase diagram in the 3D parameter space (f, Ra, Pr) and identify the following: (i) a regime where the modulation is too fast to affect Nu; (ii) a moderate modulation regime, where Nu increases with decreasing f, and (iii) slow modulation regime, where Nu decreases with further decreasing f. Our findings provide a framework to study other types of turbulent flows with timedependent forcing.