Terrain makes a lot of difference-as do buildings. I can tell a gunshot at about a 1/4 mile in the city,if conditions are right--and no, I don't know what 'right' might be; some days are better than others.
Approaching the range (out of the city) I can hear shots, occasionally, when I'm 3-4 miles away but cannot identify caliber. At the last turn-off, about 1 mile from the firing line, I can distinguish rifle from hand gun except for very large handguns and very small rifles; i.e my Encore in 270win sounds like a loud rifle, my 223 bolt gun can sound like a distant handgun.
Direction from the range is also important. Behind the shooters is much softer than to either side and if shooting is in a 3-sided berm all bets are off--too many echos.
In flat open terrain you can hear and pin point with fair accuracy gun shots and their sources. Add rolling hills and you get echos and reflection that make direction nearly impossible to determine and distance very nearly impossible to ascertain. Make the hills and valleys mountains and canyons and you probably need special equipment.
Two things you don't want to hear: the whistling warble of a bullet passing nearby and the slap, slap, slap of a bullet tearing trough foliage nearby. Need I explain why?