If your knees hurt only after riding, and not when you're walking and doing everyday things, there's an excellent chance that your problem is caused by riding too much or too hard, before proper conditioning. Or, that it's related to how your bicycle is adjusted. These things are the most common causes of knee pain in cyclists.
We can look at you and your bike to check the fit. Likely knee irritants include improper cleat and foot positioning (if you use clipless pedal systems or toe clips and straps) and seat-height and fore-and-aft adjustment errors.
Even if the bike fits perfectly, it's easy to get carried away while riding, push yourself too hard and then wake up with sore knees the next day. It's best to take it easy and build your base fitness for the first month of the cycling season by spinning easy gears (maintain a pedal rate of approximately seventy to ninety revolutions per minute). Also, avoid the hills, or at least take it easy when climbing. This type of riding will allow your delicate body joints to gradually adapt to the work load of cycling. Plus, the miles will strengthen the quadriceps muscles in the thighs that support the knees.
We're not doctors, though. If you've developed pain in your knee that won't go away, you should seek professional help before riding more. If, the knee pain is occasional, it should improve if you change your riding habits as we recommend. You may still suffer soreness after an especially hard or long ride, though. To ease the pain and help the knee recover, ice it (cover the entire knee: bagged ice available at convenience stores works great) for a minimum of twenty minutes, three times a day.
Please let us know if you're experiencing knee pain and we'll be glad to have a look at your bike and equipment and make recommendations.