Marijuana can be detected by a drug test for anywhere from a few days up to 90 days, depending on the type of drug testing used (e.g. urine test) and other personal factors.