Typically every 3-4 years, though I usually find a way for the replaced phone to remain useful.
My current model is a OnePlus 6T. I love OnePlus for their ability to install free Android distributions, in my case LineageOS. That is core Android with zero bloatware, plus root access to control every function of both the device and the OS.
I mostly use that for systemwide ad blocking via hosts file, so that no app can load adware or display ads.
I also use a firewall that determines which app is allowed to go online and which one will remain strictly offline. I use AFWall+, that has some neat config options, e.g. (dis)allowing access separately for wifi, mobile data and roaming.
Finally, I can grant and remove all privileges for each app, including system apps.
All that not just helps blocking adware/spyware, but also greatly increases battery life. Which is awesome with OnePlus anyway. The other day, I left for a weekend trip on Friday morning and forgot my charger. Came back home Sunday night with 6% battery left. And it then took me 20 minutes to fully recharge it. Can't beat that.
Before the 6T I had the OnePlus 3, that still serves as a mobile wifi router at home. I have a 200 GB data plan and easily get 40 Mbit down / 20 Mbit up, so no need for a wired internet connection.
Only downside - I kept the OP3 permanently connected to the charger, and meanwhile the battery is so bloated that the display came off. Phone still works, but a bloated battery is a fire hazard, so I will have to replace it shortly.
Lesson learned - when the 6T will become my new wifi router, I will attach the charger to a smart wifi plug connector. That way, the phone can turn the plug switch on when it drops to 30% battery, and disconnect from power once it charged to 90%. #geekpower
Ideology: The mistaken belief that your beliefs are neither beliefs nor mistaken.