Since this has been going on for quite a while, I would suggest that you go to see your primary care doctor
for evaluation. They should be able to examine your neck and shoulder and help you figure out what is going on.
The type of pinching pain you are describing in that location is mostly likely due to muscle strain
or muscle spasm. This can occur for several different reasons, including overuse of the shoulder from certain sports activities, as well as poor posture while sleeping or while working during the day (for example, being hunched over a computer all day).
If the pinching pain is accompanied by any numbness
or tingling, or if the pain runs down your shoulder into your arm, then that is more likely to be pain from a nerve source rather than from just a sore muscle.
Your doctor can evaluate you and, based on what they find, start some basic treatments. Initially treatments for these symptoms tend to include anti inflammatory medications and, occasionally, muscle relaxants. Additionally, physical therapy, or at least stretching exercises, are often very helpful, and your doctor can make a referral or describe some exercises to you.
I hope you feel better soon!