That is a circulation thing. If circulation is hampered, then muscles will stiffen. After standing for a few seconds, the stiffness should go away. If not, go to the doctor.
When you sit still for a while your blood flow decreases. You probably get cold while you are sitting still too. If you are up and about your blood flows quite well and you won't be stiff.
If this is something that happens all the time especially after sitting for a short period of time
you might want to mention it to your doctor it's really hard to determine the reason not know your
medical history age and how severe the stiffness is. I hope this helps.
For some people this is normal. However, this can be a sign of arthritis or some other joint disorder. I would see your doctor for an evaluation though.