Depending on the state you're in the landlord has between 21 and 30 days to return your security deposit to you as long as you weren't given a list of damages that were done to the apartment that wasn't normal wear and tear.
If you get a list of damages done to the apartment or rental house the landlord can legally deduct money from that deposit to cover the damages and if the damages are severe enough they can keep the whole security deposit and not return it.
After all that's what the security deposit is for is to cover any unpaid rent or damages to the apartment or house.