A damped harmonic oscillator with a sinusoidal driving force is represented by the equation
$$\ddot{x} + \gamma\dot{x} + \omega_0^2x = \frac{F_D \sin(\omega_D t)}{m}$$
where $\gamma = b/m$ ($b$ is the damping coefficient, $b=F/v$) and $\omega_0^2 = k/m$ is the resonant frequency of the oscillator. The particular solution to this equation can be determined by taking the imaginary part of the solution to
$$\ddot{x} + \gamma\dot{x} + \omega_0^2x = \frac{F_D}{m}e^{i\omega_D t}$$
If you assume* the solution takes the form
$$x(t) = A e^{i(\omega_D t + \phi)}$$
and plug that in, you get
$$-A \omega_D^2 + \omega_0^2 A = \frac{F_D}{m}\cos(\phi)$$
and
$$\gamma\omega_D A = \frac{F_D}{m}\sin(\phi)$$
Solving for the phase difference gives
$$\tan\phi = \frac{\gamma\omega_D}{\omega_0^2 - \omega_D^2}$$
This depends on the frequency of the driving force and the resonant frequency of the oscillator, but not on the amplitude of the driving force.
You can express this in terms of the dimensionless variable $x = \omega_D / \omega_0$ as
$$\tan\phi = \frac{\gamma}{\omega_0}\frac{x}{1 - x^2}$$
and if you graph it,
(graph generated by Wolfram Alpha) you'll see how the response of the oscillator jumps from leading to lagging when $\omega_D = \omega_0$ (at $x=1$), that is, when the driving and resonant frequencies are equal.
*The same solution can be obtained from Fourier decomposition without making this assumption.