This is a good, easy way to improve your knee extension if you are unable to straighten it all the way. You should be able to extend the shin so that it is in line with the femur (0 degrees of flexion).
A simple way to improve your knee extension range of motion is as follows. Prop your heel up on a bolster, arm of a couch, or anything else that allows you to get the foot slightly higher than the hip. Let gravity straighten the knee for you. If you want a little extra, you can put an ankle weight on the tibia or the femur to increase the stretch.
Maintain this position, as long as you don’t have any pain with it, for at least a minute. Consult with your physical therapist or physician to determine if this is a good stretch for you.