Here is a basic tutorial on how to find an available Wi-Fi network in your area and then to add that Wi-Fi network on your iPhone.
In the Air
The 3G network is a major development for the iPhone and an important tool, but it is rarely really enough. You are limited by what you can download, the speed is often not good enough for applications and internet browsing, and generally it presents less than stellar performance. In these cases it is almost always better to connect to a Wi-Fi signal when you can, which really steps up the game of the iPhone in general. While you are connected to a Wi-Fi signal your iPhone will maintain a much stronger internet connection and you can really get a more solid experience. It is easy to connect to the Wi-Fi network as this is a very standard part of iPhone use, even in light of the 3G network. Here is a simple tutorial laying out how to find an available Wi-Fi network and how to add Wi-Fi networks on the iPhone.
General iPhone Wi-Fi Connection
Begin by going to the iPhone's Settings application. In the very first block of options you will find Wi-Fi, which is right under Airplane Mode and right above Notifications. Right next to the word Wi-Fi it will tell you if you are connected to a Wi-Fi network, and if not it will just state that you are not connected. When you select Wi-Fi you will find the Wi-Fi networks page where you can manage all Wi-Fi connections on your iPhone. At the very top is an On / Off switch for Wi-Fi, and you will want to make sure that this is set to On. Below this will be a list of available networks in your area, which is headed by the Choose a Network text. From here you will see a number of Wi-Fi connections, how strong their signals are, and if they have a password requirement or not. You have a couple of choices here as you will not be able to add Wi-Fi networks that are locked to your iPhone without the password. You can either choose from Wi-Fi signals that do not have a lock or ones that you are already familiar with. Go ahead and select your preferred Wi-Fi connection. If you chose one that does not require a password it will verify it and connect you. If your Wi-Fi signal did require password information it will ask you for username and password info, which you will then have to enter correctly. You will then be connected to that Wi-Fi network.
Ask to Join Networks
Below the Choose a Network list on your iPhone's Networks page will be a button that says Ask to Join Networks. This will prompt your iPhone to make you aware of available Wi-Fi networks at different times when you are using an internet based application or browsing using Safari. This is only going to be an effective tool if you use Wi-Fi commonly and are in a lot of locations with open Wi-Fi signals or where you are aware of the password information. If this is the case you may want to turn off the 3G signal for long bouts of Wi-Fi use.