Light sleep. There are several sleep states varying from the light state where you will awake immediately if you hear a noise to so deep it would take great effort for someone to wake you. Nightmares & dreams generally occur in the lightest sleep states, often in the early morning hours. Sleep walking or a process known as night terrors in kids, occur in very deep sleep states , what many call core sleep.
Nightmares. Nightmares -- the vivid and terrifying nocturnal episodes where the dreamer awakens abruptly -- happen during rem sleep. Rem periods occur about every 90 minutes throughout the night. Nightmares are a defining symptom in post-traumatic stress disorder, but there are other causes also -- such as antidepressant medications, some antihypertensives, & alcohol and benzodiazepine withdrawal, etc.