It depends on the drugs half life but generally opioids will stay in the system for 24 hours. Anyone with kidney problems will have the drugs stay in their system for up to 36 hours as the kidneys cannot excrete or clear the drug out normally - nursing knowledge here.
It all depends on your body weight and how much opioids the subject has been using, but generally they will stay in your system for 3-5 days. The maximum is a week but that is only in rare cases.