Does a diatomic gas have one or two vibrational degrees of freedom?
I think this confusion arises from quite different definitions of degrees of freedom. Here are three different definitions that could reasonably arise:


Positional degrees of freedom. This leads to the common $3N$ degrees of freedom based on movement in three directions. Refer to Jan's answer. (Question: Bonds constrain atoms, so why don't they reduce the number of degrees of freedom? Answer: Bonds are not rigid constraints; the atoms don't necessarily remain a fixed distance apart.)
Phase space degrees of freedom. Here we have $6N$ degrees of freedom: $3N$ from the positions of all particles, $3N$ from the velocities of all particles. Positions and velocities are independent, so to specify a system of $N$ particles exactly requires $6$ degrees of freedom per particle. (We also presume no internal structure; as example, for rigid bodies, there are $12$ degrees of freedom: the $6$ mentioned above, $3$ more for specifiying the orientation of the body, $3$ more for describing the speed of rotation of the body.)
Quadratic degrees of freedom. This may seem like a strange distinction to make, but is a key requirement of the equipartition theorem, which is one of the areas where the concept of degrees of freedom is first introduced. These degrees of freedom are the subset of the phase space degrees of freedom whose elements all contribute quadratically to the system energy.


We will clarify these degrees of freedom with the example of a diatomic gas. In this case, there are $6$ positional degrees of freedom, $12$ phase space degrees of freedom, and $7$ quadratic degrees of freedom. Jan's answer describes the $6$ positional degrees of freedom well; specifying the $6$ analogous velocity degrees of freedom gives the $12$ phase space degrees of freedom. Let us enumerate the $7$ quadratic degrees of freedom: $$\dot{x}, \dot{y}, \dot{z}, \dot{\theta}, \dot{\phi}, q, \dot{q} \quad \Longleftrightarrow \quad \frac{1}{2}m\dot{x}^2, \frac{1}{2}m\dot{y}^2, \frac{1}{2}m\dot{z}^2, \frac{1}{2}I\dot{\theta}^2, \frac{1}{2}I\dot{\phi}^2, \frac{1}{2}kq^2, \frac{1}{2}\mu\dot{q}^2$$ Positional degrees of freedom do not play into this, because there is no quadratic energy contribution associated with them. Instead, we have the six velocity degrees of freedom from the two atoms, $\{\dot{x}_1, \dot{y}_1, \dot{z}_1, \dot{x}_2, \dot{y}_2, \dot{z}_2\}$, which we replace by the conventional center-of-mass coordinates $x, y, z$ and the two angles $\theta, \phi$ that describe the orientation of the molecule, $\{\dot{x}, \dot{y}, \dot{z}, \dot{\theta}, \dot{\phi}\}$. One degree of freedom has "gone missing", because by symmetry there is no (quadratic) energy associated with rotation about the bond axis. The bond also produces two more quadratic degrees of freedom, represented by the vibrational coordinate along the bond, $q$, corresponding to the potential and kinetic energies of vibration. 

Hence in one sense there exists only one vibrational degree of freedom; in another sense, two.



Remark. One might argue that the two vibrational degrees of freedom $q, \dot{q}$ are not independent, as they should be related by the equation of motion for a harmonic oscillator; this is important for the statement of the equipartition theorem. This is true for an isolated system, but presumably collisions decorrelate $q$ and $\dot{q}$---I don't have a better answer for this.

At any rate, experimental evidence (heat capacities) does corroborate seven quadratic degrees of freedom for diatomic molecules at high enough temperatures, when vibrational modes are active.