This depends on the kind of sleep aid you're taking.  Prescription sleeping pills should not be taken long-term because they tend to be habit-forming and have adverse side effects.  OTC sleep aids aren't meant for continuing use, either, and may have health risks if taken for several months or more.  Natural sleep aids such as herbal supplements with melatonin, cannabinol, or valerian have a gentler effect and won't cause intoxication or tolerance so they're safer to use for longer.