How long it takes for antibiotics to leave your system depends on the antibiotic. Antibiotics like cephalexin will be excreted within about eight hours of taking the medication.