Way, way at the bottom of the Cellular Data settings on your iPhone or cellular iPad is a check box for wifi-assist. If this box is active, your iPhone will use cellular data whenever you have a spotty wifi signal. While this could be handy and not cost you much if you have an unlimited data plan with your cell carrier, if you do not have unlimited data you could suddenly find yourself eating through your data plan.
If you are not on an unlimited data plan consider de-activate wifi-assist unless you really need it and then only turn it on temporarily. Go to Settings > Cellular and scroll to the very bottom of the screen to toggle On or Off.