Is there a term for this constant knee problem I've been having?

I've had a serious knee issue for a few years, but it's been giving me issues several times over the last few weeks.

Basically what happens is that whenever I go down on my knees, squat, or kneel (anything where my knees are bent), then try to stand back up and straighten my legs, my knee locks up, pulls/stretches, grinds and pops. Then my knee feels sore and a little swollen and it can hurt to walk on it for an hour or so. Sometimes the pain also radiates down to my ankle. This pretty much only happens with my right knee.

I'm not sure if it's arthritis, a torn muscle/joint/ligament issue, or something else. I'll be going to the doctor to get it checked out soon, but I'm just wondering if anyone has an idea of what it might be so I can find a way to deal with it until then.
Is there a term for this constant knee problem I've been having?
Post Opinion