1) DoF of Graviton or more precisely, modes of (because nothing is quantized here!):
Let us start by writing , where . With this definition, Einstein’s field equation at linearized level becomes:
where the RHS refers to quadratic part of the Energy-Momentum tensor. For counting physical modes, we need to consider gravitational field without any sources so we will deal with just[1,2]:
where . This linearized field equation is invariant under the following gauge transformation:
which is just the linearized version of the Einstein (general coordinate) transformation of the metric, !
Now, as is usually done, we choose a gauge called de Donder gauge: . With this gauge choice and defining , we get the following redefined equations:
de Donder Gauge:
Let us choose a plane wave solution for the field equation: . First thing to note is that has 10 components/modes (in 4-D obviously!). The question is how many of them are physical modes. You probably already know the answer but we’ll get there slowly but concretely! Let us plug the solution in the first two equations above to get:
The last equation reduces the number of independent modes in to 10-4=6. We have the following 6 ‘most general’ basis tensors for assuming wave propagation is in 3(z)-direction, i.e. :
where and so on. Let us now look at the gauge transformation of after choosing a specific form of the gauge parameter, (where C is a constant which could be absorbed in !):
As we did for , the most general basis vectors for are chosen to be . We immediately see that the choice of first three basis vectors and a ‘correct’ C makes the modes 4, 5 & 6 pure gauge i.e. . Last basis vector is a bit tricky, so let us look at this tricky identity:
And you immediately ‘see’ that (with ‘correct’ C) the mode which is gauged away is 1! So we are left with 6-4=2 physical modes:
These are the two ‘famous’ plus- & cross- modes/polarizations of the gravitational waves.
2) DoF of Photon or more precisely, modes of :
The Maxwell’s equation of motion is as follows:
This equation is invariant under the following gauge transformation:
Now, we choose a gauge called Lorentz gauge:
With this gauge choice, we get the following simplified equation of motion:
Let us choose a plane wave solution for this equation: . Firstly, has 4 components/modes (in 4-D!). Plugging this solution in the two equations above, we get:
The last equation reduces the number of independent modes in to 4-1=3. We have the following 3 ‘most general’ basis vectors for (assuming wave propagates in 3(z)-direction):
Let us now look at the gauge transformation of after choosing a specific form of the gauge parameter: (where C is a constant!) which gives:
We immediately see that a ‘correct’ C makes the mode 3 pure gauge. So we are left with 3-1=2 physical modes:
These are the two ‘famous’ linear modes/polarizations of the electromagnetic waves.
 If you are wondering which action gives that field equation, it is just the quadratic part of the Hilbert-Einstein action (which is proportional to the Fierz-Pauli action for spin-2 particle): .
 There are many subtleties involving in GR and you are welcome to read S. Weinberg’s ‘Gravitation & Cosmology’. Also this .pdf file covers Second & First Order formalism in an irritating manner but is quite good nonetheless!
 You can do a similar analysis as was done in the previous post for the case of Maxwell’s EM theory for choosing this particular gauge condition.