The molecules of diatomic and linear polyatomic gases are made up of two atoms joined rigidly to one another by a bond. Such a particle cannot only move as a entire but can also rotate about one of the three co-ordinate dimensions. Though its moment of inertia about the axis joining the two atoms is negligible compared to that about the other two dimensions. As it have only 2 rotational motions. Therefore, a simple particle has 5 degrees of freedom. At sufficiently great temperatures it has vibration energy in addition to its two degrees of freedom, Therefore at high temperatures a diatomic particle has 7 degrees of freedom, 3 translational, 2 rotational and 2 vibration.
Degree of freedom, f = 5 (3 translational +2 rotational) at room temperature
f = 7 (3 translational+2 rotational+2 vibration) at high temperature