To setup WiFi you will need to be in range of the WiFi network you wish to connect to. You may also need any network password and to have set the network to allow new connections. The instructions below are for connecting to a typical WPA secured home network, for other security methods the steps may differ slightly
open the applications tray
tap the Setup icon 
tap the WiFi icon 
you maybe prompted to switch on WiFi, tap Turn on WiFi if needed
the phone will now scan for WiFi networks in range
tap Next if you have a Welcome to WiFi setup message on screen
tap the network you wish to join
enter the pre-shared key (security key) for the network you are joining, if this is your home WiFi network you need to use the security key for your router. For a typical home network this is a 26 digit password made up of numbers and letters.
at the Save this Wi-Fi Network as a Profile anyway? field, ensure Yes is selected
click Next
click Finish