Your AirTag stops working only when the battery is out of charge or when you remove the battery. You will also lose track of your AirTag location if somebody destroys the device.