Dear,
It might have happen due to bad position of hand while sleeping.
Apply hot pack twice a day for pain relief
Next Steps
See any good Ortho Doctor and get your assessment done. and then visit a good physiotherapy centre nearby you
Health Tips
Avoid lifting heavy objects from painful hand, Do not keep hard pillows under your neck