The following excerpt is taken from the State of California’s website for the Department of consumer affairs…

Common problems and how to avoid them

The most common disagreement between landlords and tenants is over the refund of the tenant’s security deposit after the tenant has moved out of the rental unit. California law therefore specifies procedures that the landlord must follow for refunding, using, and accounting for tenants’ security deposits.

California law specifically allows the landlord to use a tenant’s security deposit for four purposes:

For unpaid rent;
For cleaning the rental unit when the tenant moves out, but only to make the unit as clean as it was when the tenant first moved in;214
For repair of damages, other than normal wear and tear, caused by the tenant or the tenant’s guests; and
If the lease or rental agreement allows it, for the cost of restoring or replacing furniture, furnishings, or other items of personal property (including keys), other than because of normal wear and tear.215
A landlord can withhold from the security deposit only those amounts that are reasonably necessary for these purposes. The security deposit cannot be used for repairing defects that existed in the unit before you moved in, for conditions caused by normal wear and tear during your tenancy or previous tenancies, or for cleaning a rental unit that is as clean as it was when you moved in.216 A rental agreement or lease can never state that a security deposit is “nonrefundable.”217

Under California law, 21 calendar days or less after you move, your landlord must either:

Send you a full refund of your security deposit, or
Mail or personally deliver to you an itemized statement that lists the amounts of any deductions from your security deposit and the reasons for the deductions, together with a refund of any amounts not deducted.218
The landlord also must send you copies of receipts for the charges that the landlord incurred to repair or clean the rental unit and that the landlord deducted from your security deposit. The landlord must include the receipts with the itemized statement.219 The landlord must follow these rules:

If the landlord or the landlord’s employees did the work – The itemized statement must describe the work performed, including the time spent and the hourly rate charged. The hourly rate must be reasonable.
If another person or business did the work – The landlord must provide you copies of the person’s or business’ invoice or receipt. The landlord must provide the person’s or business’ name, address, and telephone number on the invoice or receipt, or in the itemized statement.
If the landlord deducted for materials or supplies – The landlord must provide you a copy of the invoice or receipt. If the item used to repair or clean the unit is something that the landlord purchases regularly or in bulk, the landlord must reasonably document the item’s cost (for example, by an invoice, a receipt or a vendor’s price list)220
If the landlord made a good faith estimate of charges – The landlord is allowed to make a good faith estimate of charges and include the estimate in the itemized statement in two situations: (1) the repair is being done by the landlord or an employee and cannot reasonably be completed within the 21 days, or (2) services or materials are being supplied by another person or business and the landlord does not have the invoice or receipt within the 21 days. In either situation, the landlord may deduct the estimated amount from your security deposit. In situation (2), the landlord must include the name, address and telephone number of the person or business that is supplying the services or materials. Within 14 calendar days after completing the repairs or receiving the invoice or receipt, the landlord must mail or deliver to you a correct itemized statement, the invoices and receipts described above, and any refund to which you are entitled.221
The landlord must send the itemized statement, copies of invoices or receipts, and any good faith estimate to you at the address that you provide. If you do not provide an address, the landlord must send these documents to the address of the rental unit that you moved from.222
http://www.dca.ca.gov/publications/landlordbook/sec-deposit.shtml