This symptom of having pain in the knees when seated sounds a lot like patello femoral pain syndrome, also known as chondromalacia or runner's knee. This is a very common problem in younger people who are active or have a history of activity.
Essentially patello femoral pain syndrome occurs when the cartilage on the underside of the patella (knee cap) tracks improperly over the underlying femur (large leg bone). This leads to pain and "creaking" of the knee. Characteristically, the pain is worse when seated for prolonged periods and also with certain activities such as climbing stairs that also involve bending the knees.
Patello femoral pain syndrome can usually be treated with a combination of resting from high impact exercises and anti inflammatory medications like ibuprofen. Additionally, it is worth having your gait analyzed (in a good athletic shoe store) because overpronation probably contributes to some cases and can be corrected with the proper athletic shoes. Finally, strengthening exercises of the quadriceps can be very helpful (bearing in mind that no knee bending exercises should be performed).
You should talk to your primary care doctor
about this problem, as they will be able to help you decide on how to treat it!