What rules govern the return of the security deposit to the tenant?

Q. What rules govern the return of the security deposit to the tenant?
A. Residential: Upon termination of a rental agreement on residential property, the landlord must furnish the tenant the unused portion of the security deposit and an itemized statement showing what deductions have been made, no later than 21 days after the tenant vacates the property. (Cal. Civ. Code § 1950.5(g).) The itemized statement must be accompanied by receipts or invoices issued by the person that performed the work that the deductions were used to pay for; or, if the landlord or landlord’s employee performed the work, the itemized statement must list the work that was done, the time spent, and the reasonable hourly rate charged. (Cal. Civ. Code § 1950.5(g).)
C.A.R. Sample Letter “Security Deposit Return” (Form SDR) may be used for this purpose and can be found in ZipForm within the C.A.R. Sample Letters library.
If the landlord retains any of the deposit in bad faith, s/he will be liable for up to twice the amount of the deposit in punitive damages, as well as any actual damages the tenant may suffer. (Cal. Civ. Code § 1950.5(l).)
A. Commercial: For commercial leases, the deadline for returning a deposit is generally 30 days. However, if the landlord only claims deductions from the deposit based on defaults in the payment of rent, and if the deposit exceeds one month plus the last month’s rent, then any amount exceeding one month’s rent must be returned within two weeks. (Cal. Civ. Code § 1950.7(c).) If the landlord retains any of the deposit in bad faith, s/he will be liable for up to $200 in punitive damages, as well as any actual damages the tenant may suffer. (Cal. Civ. Code § 1950.7(f).)
For more information, please see the C.A.R. Legal Q&A, Security Deposits.

Q. May a tenant take the landlord (or vice versa) to small claims court over a security deposit dispute?
A15. Yes, as long as the damages claimed do not exceed the jurisdictional limit for small claims court ($10,000 in most situations where the claim is brought by a natural person.). (Cal. Civ. Code § 1950.5(n); Cal. Code of Civ. Proc. §§ 116.220, 116.221.)