We present a theory for the kinetics of surfactant adsorption at the interface between an aqueous solution and another fluid (air, oil) phase. The model relies on a free-energy formulation. It describes both the diffusive transport of surfactant molecules from the bulk solution to the interface, and the kinetics taking place at the interface itself. When applied to non-ionic surfactant systems, the theory recovers results of previous models, justify their assumptions and predicts a diffusion-limited adsorption, in accord with experiments. For salt-free ionic surfactant solutions, electrostatic interactions are shown to drastically affect the kinetics. The adsorption in this case is predicted to be kinetically limited, and the theory accounts for unusual experimental results obtained recently for the dynamic surface tension of such systems. Addition of salt to an ionic surfactant solution leads to screening of the electrostatic interactions and to a diffusion-limited adsorption. In addition, the free-energy formulation offers a general method for relating the dynamic surface tension to surface coverage without relying on equilibrium relations.