Apple Airtags have batteries that are meant to last more than a year. However, the life of an Apple Airtag battery is also impacted by everyday use. Apple's estimation of battery life is based on Apple's testing and is dependent on using the Airtag daily with about "four play sound events and one Precision Finding event per day," according to Apple's website.
So, if you use the Apple Airtag more frequently, the battery could last less than a year. However, if you use the Apple Airtag less than the tested daily use, your Airtag could last longer. Luckily, if your Airtag battery is getting low, it will send an alert to your phone to let you know you need to change your battery.