There are threads that talk about that, but it appears that the menu for our GS5 is different than what the threads show. You want to go back to "keep wifi on during sleep" and change it back to you always. Otherwise, wifi turns off when your phone goes to sleep, and is not connected when you first wake it back up.
Give that a shot, and see if you can turn wifi back on. If not, try rebooting, and if its still persists, a factory reset will most likely be in order.
Posted via Android Central App