Different drugs have different half-lives. For example, Adderall has a longer half-life of 10 hours, while heroin has a shorter half-life of around 30 minutes. Some drugs will remain in your system several days after use, while others weeks.
Morphine is detectable in blood tests for up to 3 days.
Morphine is detectable on a saliva test about 3 days after the last use.