Fortunately the majority of time people are able to cope with everyday stressors, and they do not affect sleep. But if the stressor occurs right before you're going to sleep, it's possible that the release of stress chemicals could affect your ability to fall asleep. Very severe stressors can lead to nightmares and cause you to wake up.
How does your mental state affect sleep?
Most experts associate depression with middle-of-the-night awakening and early morning awakening. Early morning awakening is when you have to get up before you want to in order to get to work or school.
On the other hand, anxiety and anxiety disorders are more commonly associated with a difficulty in falling asleep and staying asleep.
What anxiety states can disturb sleep?
Generalized anxiety disorder is a common anxiety disorder characterized by exaggerated arousal. It can be manifested during sleep, particularly if a person lies awake worrying when he or she should be sleeping.
Panic disorder is an interesting form of anxiety disorder. It's characterized most specifically by unanticipated, spontaneous attacks of severe anxiety. These attacks build to a crescendo in a very short period of time, and they can be associated with a variety of physiological and psychological difficulties. A person feels their heart rate going up and they start to sweat. Psychologically, a person may feel so anxious that they are concerned about dying.
Probably about two-thirds of people with panic disorder will have panic attacks at one time or another during sleep. So a person typically awakens from what's called a nocturnal panic attack feeling quite anxious, and it can be quite disturbing.