Simply, the number of elements in a numerical array that you’re allowed to change so that the value of the statistic remains unchanged.
# for instance if: x + y + z = 10
you can change, for instance, x and y at random, but you have no choice (no freedom) about what it changes to. You can change any two values, but not the third, ’cause you’ll change the value of the statistic (Σ = 10). So, in this case df = 2.