in my experience it's about 13 tiles. although I'd like to have confirmation that units have to be close together to have an impact.
in my last game, I have units garrisoned in 5 cities around a CS, within 13 tiles, but gunboat didn't kick in; yet once I tele'd them to one city it kicks in.