Mine works from at least a few miles away- haven't tested it beyond that. I have an iPhone 8.
My elderly mother lives 15 miles away. She has one on her keys that I track. I was in Nova Scotia last week (live outside of Boston) and successfully checked her location a number of times when away.
Keep in mind, AirTags rely on communicating their location via Bluetooth through nearby Apple devices.