What are the causes of stiff and painful finger joints after waking up?

Some people have a feeling of difficulty in flexing and extending their fingers, stiffness in the joints and some pain and swelling after waking up, which we call morning stiffness” and is relieved by moving around for a while or being placed in a warm environment.