On demand turn-on the Wifi on iPhone is one way to gain a longer battery life. However, switching Wifi between ON & OFF is not so straightforward on iPhone. You need to tap Setting -> Wi-Fi -> ON/OFF to switch on/off the Wifi.

For iPhone jailbreak user you have the privilege to use Wifi toggle application for free. A mini application known as “WifiToggle” allows you to toggle the Wifi directly on the Home screen. Just tap it to switch on the Wifi and tap it again to turn Wifi off. You can find the application in Cydia or Installer 4.0.