How to prevent iPhone from dropping wifi connection when it goes to sleep?
I have the same iPhone and the same problem. I just went into Settings > General > Reset > Reset Network Settings. Then reconnect to your wifi like normal. 

This worked for me, however if the problem is still there, maybe turn your data off when using wifi. Hope one method works for you (: