Stiff knees can occur for many different reasons including arthritis, a sprain, a strain, or any other injury. These stretches should help.
Doing patella (kneecap) mobs is a great way to get the knee loosened up. Since the patella is connected to the quad tendon and the patellar tendon, if it gets tight, it will put pressure on the knee joint.
Since the calves, hamstrings, IT band, and quads all cross the knee joint, it’s really important to stretch those muscles to help relieve stiffness and tightness in the knee.
Finally heel slides lying down and seated can really help decrease stiffness in the knee.