For all I know, an one-dimensional free particle has 1 degree of freedom and 3 degrees of freedom in the 3-D world. And in thermal physics, one-dimensional simple harmonic oscillator has 2 degrees of freedom, it is a different concept with the "degrees of freedom" in mechanics.
However, my professor who teaches quantum mechanics said that there are 2 degrees of freedom for an one-dimensional free particle and they are $x$ and $p$ (i.e. position and momentum) respectively. Then according to this, he explained that one atom in a solid has 6 (there are 3 directions i.e.$x$, $y$, $z$ and 2 degrees of freedom for each direction) degrees of freedom. And he still sticks to his own opinion.
But no book has ever said that like my teacher. I'm getting confused. So I hope someone could explain the concept of degrees of freedom to me.