Per IRS Publication 946 How to Depreciate Property, page 7:
Retired From Service
You stop depreciating property when you retire it from service, even if you have not fully recovered its cost or other basis. You retire property from service when you permanently withdraw it from use in a trade or business or from use in the production of income because of any of the following events.
For additional information, please refer to IRS Publication 544 Sales and Other Dispositions of Assets.