That's really a misnomer. Landlords almost never hold back security deposits.
The real reason for "security deposits" is to help reassure the landlord that the prospective tenants will pay the rent on time. Not even having two months of rent saved up is a sign that the tenant is not able to manage money well and will likely miss the rent too.
In Californiastan landlord has 14 days to settle up the security deposit and mail refund to previous renter.