How does the equipartition theorem apply to vibrational modes?
As you probably already know, the equipartition theorem states that each quadratic
degree of freedom will, on average, possess an energy $\frac{1}{2}kT$, where a ‘quadratic degree of freedom’ is one for which the energy depends on the square of some property.
Now lets consider the kinetic and potential energies associated with translational, rotational and vibrational energy:

Translational degrees of freedom:  $~E = \frac{1}{2}mv^2$

Rotational degrees of freedom:  $~E = \frac{1}{2}Iω^2$

Vibrational degrees of freedom: $~E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2$


As you can see that for translational and rotational degrees of freedom, there is only one quadratic. Hence each translational and rotational state will contain $\frac{1}{2}kT$ energy.
However for vibrational states, the energy contains two quadratic contributions. Therefore each vibrational state will contain $kT$ energy.
Now lets consider the reasoning behind this. You are right when you say that the vibrational degree of freedom depends on kinetic and potential energy and hence has 2 quadratic contributions. In the equation for the energy of the vibrational state, $\frac{1}{2}mv^2$ represents the kinetic energy and $\frac{1}{2}kx^2$ represents the potential energy.
A molecule in the vibrational state acts like a harmonic oscillator. So let consider $H_2$. You can imagine that the bond between the 2 hydrogen atoms is like a spring which contracts and expands in length.

The average bond length can be thought as the equilibrium length of the bond. When the bond the contracts, the displacement from this equilibrium length is known as 'x'. Now using Hooke's Law, the potential energy of the system is $\frac{1}{2}kx^2$ where k is the spring constant while the kinetic energy is $\frac{1}{2}mv^2$. Hence the total energy of the system is given by: $~E = \frac{1}{2}mv^2 + \frac{1}{2}kx^2$