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. 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.
Update: For iPhone firmware 2.x user, you may check out SBSettings on Cydia. This is an even better application for controlling Wifi Toggle. You can refer to this post for complete review of SBSettings.