Osteoarthitis or degenerative joint disease can cause pain in joints, particularly weight bearing joints such as the knees or hips. This is the type of arthritis that we get as we age. People who are overweight or smoke can develop this more quickly but people without these issues can also develop it due to hereditary causes.
It is classic for this type of arthritis to be worse when you have not been active for awhile, i.e. sleeping all evening or sitting for extended periods, and then ease up as you start to walk around.
Although this sounds like your issue it is best to have a medical provider evaluate your knees to make sure there are no other potential causes for your complaints such as gout, lupus or infection.
Sincerely, Jennifer. I hope my answer helped you. If it did please be sure to give me a good rating. If it did not please contact me as I would be happy to help you further.