Standard wifi is phy limited to ~1600m unless you can increase ack response time limit, otherwise retransmissions will be sent by the sender while ack's are being transmitted by the receiver.
Then, per friis equation, with enough power and antenna gain (it's the antenna gain that really matters) the limit is only obstructions/terrain. Get yourself high enough (mountains, planes, satellites, moons, etc), or bounce of an opportune reflector (planes, moon, aurora, meteors, ionosphere, rain, hail, etc), and there is no real limit, besides how big of an antenna you're willing to build in orbit :P
or just make the throughput really really really REALLY slow and ice your receivers with liquid He.
Hams make a game of it: https://www.arrl.org/files/file/WA50-Standings/Distance-Reco...