There's a feature that some carriers turn on that checks for wifi networks that you've already established a connection with. If you're nearby it turns on automatically. I guess it's intended to help you keep your data down.
I think it's in settings under networking. I had to hunt for it to uncheck it and make it stop.
on my phone the app is att smart wifi and it turns wifi off and on depending if i can get a connection or not, works pretty good, sometimes I pick up the phone and the wifi will instantly connect once the phone is turned back on.