There is no real solution if not to have a data service with your mobile service provider....
I'm having the same problem and it's getting worse with each IOS upgrade. I believe it all worked perfectly until IOS 7. Until then wifi never disconnected an app running in the background or if the phone was on lock.
I am using skype and whatsapp on my phone and if I am connected to wifi, only the app that is running in the foreground is connected to wifi. In other words, if whatsapp is in the background whilst I am connected on skype then I won't get any notification on incoming chats or calls on whatsapp and vice versa. And this applies to all apps running in the background including mail service.
During IOS 9 it was still possible to keep wifi from disconnecting if the phone was connected to a charger or any other external power supply but now with IOS 10.2.1 even this behaviour is gone. And there is not even a feature where I can choose to keep wifi on all the time unless you jailbreak your phone, unfortunately jailbreak for my iPhone 5s IOS 10.2.1 isn't out yet.
Now, normally if you have data service with your provider and your iPhone connects to wifi, data service will be switched off which normally is good as you'll save some money on your monthly phone bill but now you will pay that saving by not getting the push notifications of apps like whatsapp, skype, mail, etc.
So you trade one for the other. If you have a data service you can see that everything works fine as long as you are not connected to wifi i.e. you are in a spot w/o any known wifi.
So in a way, Apple is forcing us to keep data service on and wifi off if you want to stay connected and thus Apple is forcing us to spend money just for the sake of "extending" their phones battery life.
But that's Apple policy since Steve Jobs, who told us what we need even we didn't know that at the time and, worse, he dictated how we use the products he invented, letting us pay for it w/o a chance to influence the development. But that's Apple.... it's "my way or the highway", they want slaves not customers.
I don't mind to recharge my iPhone every night so what the heck with short battery life..... I even have a power bank always with me but that's not the issue.... I want to be connected via wifi when I am at home or at any other space where I can connect to wifi.... If I run out of battery, it is my problem.... I don't need papa Jobs to decide what's best for me....
As I mentioned above... I'm eagerly waiting for IOS 10.2.1 jailbreak to come out....