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.
My recommendation if you are not on an unlimited data plan is to de-activate wifi-assist unless you really need it and then only turn it on temporarily.