It's a question of how many independent variables you need in order to write out the equations of motion.
Let's walk through it step by step.
Start by just considering Pulley 1 and Mass A. If they're joined by a massless inextensible cable (as shown in your figure) then the displacement of Mass A can be determined as a function of the rotation and radius of Pulley 1. So we only need 1 degree of freedom - the rotation of Pulley 1.
If we added a spring in between Pulley 1 and Mass A then we would no longer be able to directly relate the position of Mass A with the rotation of Pulley 1. Now we need 2 degrees of freedom - the rotation of Pulley 1 and the displacement of Mass A.
Now add Pulley 2 into the mix. If Pulley 1 were connected to Pulley 2 by a massless inextensible cable, then we could define the rotation of Pulley 2 as a function of the rotation of Pulley 1. However, we've got a spring in there so we need to know the rotation of both pulleys.
Continuing with this logic and looking at Mass B and Mass C -- if either one were connected to Pulley 2 using a massless inextensible cable, we could define its position as a function of the rotation of Pulley 2. However, we've got springs attached to both masses, so we need independent variables to describe their positions.
Then Mass A and Mass C need to be connected to the ground via springs to keep the whole thing from unraveling and dropping all the weights on the floor. (I think)
Thus, we need four degrees of freedom -- rotation of Pulley 1, rotation of Pulley 2, displacement of Mass B, and displacement of Mass C. The displacement of Mass A is a function of the rotation of Pulley 1.