most nights whilst Im asleep I put my hand on my head with my elbow in the air.  I regularly wake up with a sore shoulder.  I am continuously trying to keep my elbow at 90 degrees to my head to which I am constantly correcting. At first my wife and I found it very amusing as she described my elbow waving about in the air but it is starting to become an irritant....
Develop proper sleep posture. If you feel keeping hand under head you shoulder is sore then don't sleep like that sometime. Let the sore area heal. Pain and soreness is a body way to warn us that something is not right, and we need to slow down a bit. Also avoid heavy living from that upper limb, avoid sports and do normal range of motion exercise shoulder as tolerance. You will be fine in a month or so