A sale does not automatically end the rental agreement; the new owner takes over its obligations. When ownership changes, give the tenant written notice of the change under New Mexico Statutes § 47-8-21 ↗.
If you want to end an ordinary month-to-month tenancy, written notice must be given at least 30 days before the periodic rental date stated in the notice. For a week-to-week tenancy, the minimum is seven days before the termination date under § 47-8-37 ↗. A fixed lease and applicable local rules still matter. These periods address ending periodic tenancies; the sale itself does not end the lease or set a move-out date.
For a security deposit, keep the lease, current balance, and deposit records together, and note who holds the money. The new owner takes over the rental agreement obligations; include the agreed treatment of the actual deposit balance in the written sale and closing terms.