First things first, you want to make sure your own personal Wi-Fi networks is secured using Wi-Fi Protected Access (WPA) or another wireless security protocol. (Refer to the product literature that accompanied your wireless router for more on how to enable Wi-Fi security.) When you connect your iPhone to that network for the first time, you’ll be prompted for the network’s password–assuming you’re using some sort of Wi-Fi security. You should also modify the name of your personal Wi-Fi network to something custom, to help reduce the chance of coming across another network with the same name.
To ensure that you don’t unknowingly connect to Wi-Fi networks while on the go, you should enable the iPhone’s Ask to Join Networks function. You can turn this feature on by once again tapping the main iPhone Settings tab and then choosing Wi-Fi. On the main Wi-Fi settings screen, turn the Ask to Join Networks function on by simply tapping the on/off button next to the option. After the feature is enabled, you’ll never connect to an open Wi-Fi network without first being asked to confirm the connection. (The device will still automatically connect to recognized networks, or networks to which you’ve connected in the past.)