Taking a look at my list of apps for WiFi Automatisation, it seems Smart WiFi Toggler is a good candidate for you:
- turns WiFi off when not connected to a network
- turns WiFi on when a known hotspot is present
- constantly learns where your hotspots are located to make its decisions
- Uses your network location. No GPS battery drain.
Smart WiFi Toggler (source: Google Play; click images for larger variants)
As you can see by the first two screenshots, the app uses CellIDs for location – which means no extra drain, not even for network (would work with mobile data disabled even), as your phone knows the connected cell anyway (needed for calls).
I'm not using this myself (I rather use Tasker which can do this as well, and many other things, but is not available for free except for a 7 day trial). But according to its ratings (more than 4 stars), it should be a good choice.
For alternatives, there's WiFi Automatic which also offers to turn off WiFi e.g. when not connected for a configurable time (default: 1 minute) and to re-enable it when you're in a specified location (again identified by CellID), and also Wi-Fi Matic which works quite similar to Smart WiFi Toggler. And there's my initially mentioned list for even more candidates :)