I wait until the battery is no longer useful. Unfortunately, the iPhone makes it difficult at best to DIY a battery change, at worst expensive to have it done officially. Taking care of a battery gets it to about 4 years, and then you’re looking at Apple ending support not too long after that. Decent enough time to switch out phones.