The rate of disappearance of a drug (or anything you ingest) is based on the metabolism of that drug. This differs for each person, and it depends on body weight, activity, health and other factors. It also depends if you are interested in the drug's activity, or in its detectability. Activity usually only lasts a few hours. However, the metabolites, the bits and pieces of the inactive drug after it breaks down are still in your body and detectable by urine and blood tests for some time after the activity wears off. The psychology department at the University of Calgary has a good synopsis of the facts for psychoactive drugs. A chart of estimated times is available online at "Beat Drug Testing".
making a small donation to science.ca.