This guy needs crutches to protect his healing knees, but the doctor said biking was OK. How can your knees be hurting if bicycle riding is easy on the knees?
TL;DR; Raise your seat!
Photo credit: Loud Bicycle (cc)
Your knee should be almost straight when your feet are at the bottom of the pedal cycle. If your knee is too bent, then you put unnecessary strain on it; as if you were doing a Kozachok dance for the duration of your ride. Raising your seat will make your knees straighter, give you more power and with less strain too.
Here is an example of a good seat height, you can see that her leg is almost completely straight as her pedal bottoms out. This position is really natural, the angle of her knee is pretty close to what it would be if she were walking.
Photo credit: Richard Masoner (cc)
But if you can take a bicycle selfie with both feet and the ground then your seat is probably too low (or your bike is too small). If your seat is at the proper height, you will probably need to hop off the seat in order to comfortably put your foot down.
Photo credit: torbakhopper (cc)
Why is standing up on your bike an easy way to get more power? One reason is because your leg stays straight the whole way down and you can put all your weight into the pedals. By raising your seat, you become a little bit closer to a standing position and you get that extra power all of the time.
Photo credit: FaceMePLS (cc)
You can get even more power if your bike has a very aggressive posture, then you can pull on the handlebars opposite to pushing with your leg, though this method isn't so comfortable.
If you have knee pain but you are sure your seat is not too low, your seat might actually be too high. A seat too high typically leads pain in the back of the knee because your knee is locking with each pedal cycle as your leg becomes too straight. With a seat too low, the knee pain will be at the front of the knee. If you still aren't sure where the pain comes from, don't accept it, step into any bike shop and they will help you out.