Wi-Fi connectivity isn't always the best way to connect to the internet, and Apple knows it.
At the moment on iOS you have to manually switch to mobile data. If you're on a poor Wi-Fi connection it'll just keep trying and you'll get stuck with some horrible loading times.
It's a simple enough idea, but neither Android or Apple seem to have worked out a fix until now. If you're on a limited internet package you'll be able to toggle the feature under Settings and the bit called Wi-Fi Assist.
The feature has been spotted inside the developer version of iOS 9, but you can expect it to be in the full version when it launches in September - probably alongside the iPhone 6S.