How to stop Wifi from automatically turning itself off?
Turn off Connection Optimizer


Settings -> More Networks -> Mobile Networks -> Connections optimizer -> TickOff connections Optimizer


Or Turn Off Wifi Timer


Settings -> Wifi -> Tap the vertical ... and then Advance -> Wi-fi timer -> Turn off any timer selected.


I hope this works for you.