An air filter in a lawn mower can last awhile as long as you use an air hose and blow the accumulated dust out of the air filter.
Some air filters such as on push lawn mowers can also be washed out and dried if they're the sponge type air filter.
I've had the same air filter in my push lawn mower and riding lawn mower for 6 years now and just blew the air filters out with an air hose and it's been fine.
You should clean the air filter on the lawn mower every season or at the end of each mowing season or if you mow in a lot of dusty areas then blow it out more often to keep the engine running properly.