Ambien is typically prescribed for people who have trouble falling asleep, staying asleep, or who wake up frequently during the night. It is important to note that Ambien is intended to be used as a short-term treatment for insomnia, typically for 7 to 10 days. Prolonged use should be avoided. It should be taken immediately before bedtime and only by individuals who are able to get a full night's sleep (at least 7 to 8 hours) before they need to be active again.