This phenomenon is quite normal and you need not worry about it. Some people even sleep with their eyes open or looking up. This will not cause harm to your eye heath. But the crossed-eye when you are sleeping can be associated with headache. If the crossed-eye happens along with the headache, you should take it seriously. But drugs should be avoided, for they may cause side effect. Instead, you should see your doctor or an optometrist for advice. When you have eyestrain, your eyes can also cross when you are sleeping. The eyestrain is the result the overuse of the eyes, for example staring at computer screen or driving for a long time. So, you should have a good rest and your eyes will soon recover.
If your eyes cross when you sleep, your eyes may get infection because of the invisible bacterium. You should better use some eye drops with anti-inflammation to release your symptom. You could also use the warm compress to make your eyes get clear at the vision. You should eat more food with vitamin C to moisture the eyes.
Well, from your description, I have to say that you may suffer from crossing eyes, which is a condition related to the inability of your eyes to work together when you focus. And generally speaking, if you have cross eyes, each eye will move in a different direction and look at cross points. Also, according to some experts, crossing eyes can just lead to some other symptoms. For example, your eyes cannot align in the same direction. Also, uncoordinated eye movements, double vision, reduced vision in one of the eyes can be possible too. For the causes, one of the causes of crossed eyes is unequal pulling of muscles on one side of the eye. Another cause of crossed eyes is a paralysis of the ocular muscles. For your situation, you should see your eye doctor as soon as possible. And maybe treatment such as wearing a patch over one of the eyes, visual exercises, and glasses with the correct prescription can be helpful.