How to keep the Wi-Fi turned on when iphone 4s is locked?

My phone is disconected and i jave to text with Wi-Fi but the problem is, i can't get any notifications when my phone is locked because the Wi-Fi shuts off, is there any way to fix this?

I Have an Iphone 5 & Had an Iphone 4 Girlfriend got it now. It all depends how good your internet is & If it keeps disconnecting when your Iphone is locked then your internet strength isn't good enough & Won't detect the notifications at all. Don't Think it's your Iphone