It depends on which medication. Drugs stay in your system according to their half-life. half-life is defined as the time it takes for half of the amount of the drug you ingested to be undetectable in the bloodstream. For example, heroin has a very short half-life-- like 3 hours. So 3 hours after using heroin, there would be half the amount remaining in your system. 3 hours later, that amount would cut in half again.
Some pain meds have very long half-lives. Methadone for instance has a very long half-live, as long as 40 hours or more. A drug's half-life will be included in the prescribing literature that is given along with a dispensed drug.
Click Here to search for a treatment center in your state that is right for you.