This sounds like a simple muscle strain from sleeping in an awkward position, not anything structural. Stiffness and limited movement commonly follow 2 to 3 days after this kind of sprain, even once the sharp pain itself has settled down.
Next Steps
Apply a warm compress to the area for 15 minutes a few times a day and move your neck gently within a comfortable range rather than keeping it still. A mild pain reliever can help if needed, and gentle stretching usually restores movement over the next few days.
Health Tips
See a doctor if the stiffness hasn't eased in a week, or if your arm develops numbness or weakness.