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