You could have done a number of things to your knee, from a slight bruise to a fractured patella. If you can barely move it, or there's swelling, or pain is persistent for a couple weeks, then see a doctor to diagnose your injury.
If you don't have any swelling and you have full range of motion (i.e. you can bend and extend your leg), then your main goal should be to keep moving it so it doesn't get stiff. It's important to protect your range of motion because if you lose, say, five degrees of motion when you extend your leg, then you'll have trouble walking, running, or taking the stairs.
An exercise called the heel slide can help you maintain range of motion. You'll need a smooth surface like your kitchen floor to lie on. Remove your shoes, but leave your socks on.
Heres how to do it:
 Lying flat on your back, slide your heels to your butt. Keep your toes pulled up toward your shins so that only your heels touch the floor.
 Squeeze your hamstrings (the backs of your thighs) when your heels are as close to your butt as you can get them.
 Straighten your legs back out, contracting your quadriceps muscles again when your legs are straight.
Perform two to three sets of 10 to 15 heel slides daily. If you experience a sharp pain, stop. Don't worry about a dull or achy painit should decrease.
-- Sue Falsone, Director of Performance Physical Therapy, Athletes' Performance
Support Outside Online
Our mission to inspire readers to get outside has never been more critical. In recent years, Outside Online has reported on groundbreaking research linking time in nature to improved mental and physical health, and we’ve kept you informed about the unprecedented threats to America’s public lands. Our rigorous coverage helps spark important debates about wellness and travel and adventure, and it provides readers an accessible gateway to new outdoor passions. Time outside is essential—and we can help you make the most of it. Making a financial contribution to Outside Online only takes a few minutes and will ensure we can continue supplying the trailblazing, informative journalism that readers like you depend on. We hope you’ll support us. Thank you.