We study transport across a time-dependent magnetic barrier present on the surface of a three-dimensional topological insulator. We show that such a barrier can be implemented for Dirac electrons on the surface of a three-dimensional topological insulator by a combination of a proximate magnetic material and linearly polarized external radiation. We find that the conductance of the system can be tuned by varying the frequency and amplitude of the radiation and the energy of an electron incident on the barrier providing us optical control on the conductance of such junctions. We first study a $delta$-function barrier which shows a number of interesting features such as sharp peaks and dips in the transmission at certain angles of incidence. Approximate methods for studying the limits of small and large frequencies are presented. We then study a barrier with a finite width. This gives rise to some new features which are not present for a $delta$-function barrier, such as resonances in the conductance at certain values of the system parameters. We present a perturbation theory for studying the limit of large driving amplitude and use this to understand the resonances. Finally, we use a semiclassical approach to study transmission across a time-dependent barrier and show how this can qualitatively explain some of the results found in the earlier analysis. We discuss experiments which can test our theory.