Neck pain is usually not serious unless the neck pain is accompanied with numbness or loss of strength in your arms or hands or you experience shooting pain in your shoulder or your arm.
If you experience neck pain with those symptoms then you should certainly see a doctor or go to urgent care or the emergency room especially if the neck pain gets worse.
Sometimes just sleeping in the wrong position having your head in a bad position when looking at something can cause temporary neck pain.
I used to wake up with neck pain a lot until I got some new pillows as the pillows were causing me to sleep in the wrong position and my neck would hurt in the morning.
Usually just stretching your neck or taking some pain medication will help get rid of the neck pain but if the neck pain lasts longer than a few days or gets worse see a doctor or go to the emergency room just to be safe.