A sale does not by itself cancel a tenant's lease or rental agreement. Under California Civil Code section 821, the buyer takes the property subject to the lease and gets the same rights to collect rent and enforce it. The sale alone does not set a move-out date. If possession needs to change, the lease and applicable notice and possession rules still matter; local rent and eviction rules may also apply.
When ownership changes, you have two choices for the deposit
After lawful deductions, California Civil Code section 1950.5 gives you two choices for the remaining deposit. You can transfer it to the buyer and notify the tenant by personal delivery or first-class mail. That notice must identify any claims against the deposit, the amount transferred, and the buyer's name, address, and phone number.
Or, you can return what remains to the tenant with an itemized accounting. If the required transfer or return steps are skipped, the buyer can share liability for the deposit. Keep the lease, deposit records, and tenant communications together for the closing discussion.
Read California Civil Code section 1950.5(i)–(k)
The new owner gives tenants contact and rent-payment information
California Civil Code section 1962 requires the new owner to give tenants its contact and rent-payment information within 15 days. This is a contact and payment notice, not a move-out deadline. Share the leases, deposit records, and tenant notices so the closing can account for the handoff.
Read California Civil Code section 1962