Btw that also depends a bit - I have some legendary items that are from 10 levels below my current level, where I have had some new legendary item offers in the shop that were less powerful and useful.
There is some random variation in quality even within legendary items at same hero level, e.g. gold item A might have base stat 100 and bonus stat 85, and another gold item might have 105 + 50, or even only 90 + 40. So, how fast an item gets outdated depends a lot on their original quality compared to the possibilities of random variation.
And some kinds of items (e.g. gauntlets, belts or boots) seem to be very rare compared to e.g. crowns/helmets, weapons or armor.
I think I wear the same legendary gauntlets since 15 levels or so, because I just don’t get better offers. And, as I like a blunt+ice combo for gauntlets and weapon, a pair of slightly stronger gauntlets that deal fire damage doesn’t really help me.
So there is no exact amount of levels, it depends on 1. original quality, 2. rareness of item/stat type and 3. combinations that you want to use.