Insomnia occurs when a person has difficulty falling or staying asleep; or wakes up and remains awake for long periods during the night. Insomnia is defined as chronic when it occurs at least three nights a week for a month or longer. Common causes of chronic insomnia are depression, chronic stress, and pain or discomfort at night.