Sleeping tablets have varying lengths of efficacy. there are a really three types of sleeping tablet. one is a natural remedy type (of which i have little knowledge of), one is tablets such as zopiclone (this is a common one to be used within mental health settings as it has a much smaller list of side effects when compared to sleeping medications which are part of the benzodiazepine family.) and finally the benzodiazepines themselves (ie. Temazepam, nitrazepam etc.).
as a rule of thumb:
zopiclone is a short acting sleeping medication. it is basically used to assist in the initial "falling asleep" after which the brains natural sleep cycle should kick in. the effects of zopiclone last for about 2 hours. some people experience a slight "hangover" effect on waking in the morning, but it usually wears off very quickly. (a good way of avoiding this hangover is to have a warm milky drink and a biscuit or two just before or just after using the medication.)
temazepam, nitrazepam etc. these tend to be used less in a mental health setting unless zopiclone has been unsuccessful or if the person has been using the drug previously and with success. one of the inherent problems with benzodiazepines is that they are longer lasting. (they can remain effective within your system for about 8 hours or more.) they have a longer list of side effects and they can be quite addictive. also, they can lose their efficacy on a fixed dose and often need the dosage to be increased to maintain a similar effect on the person taking them.
for more information on any medication and their respective dosages and side effects see www.bnf.org
anyway, hope this helps a little.
Be Well.