That depends on the smartphone brand you buy.
iPhones are updated for 5-7 years as best I know.
The old Motorola Droid Turbo I had stopped getting updates after 1 year and is the reason I'll not buy another Motorola smartphone.
My Samsung Galaxy S9 is just over two years old and there will be no more Android OS updates to it, though Samsung may continue Security Updates for it.
I'll hang onto my S9 as long as it works at this point. I don't believe in buying the "latest and greatest" smartphone every other year. I don't do more than text, occasional video and listening to music on it. I don't do my online banking with it or anything that has to do with my personal information on it. Text, video and music is enough for me. As long as the battery holds a charge through the day, I'm sticking with what I have.
Yep, current is an LG V20 with replaceable battery and works fine. LG updated the phone for S. Korea but appears unwilling to update this model to Android v9, which new enterprise software requires. So If they abandon their phones after 5+ years I won't buy another LG, I guess perhaps Samsung this time.