First check ur wifi settings, Go to settings >>Communications >> wireless & networks >>Wifi Settings >> Network notifications.
This will notify you whenever open network is available. Further, if it is a secured network, then go to ''Add Wifi network'' in wifi settings and enter network SSID and passcode. Also, some networks are WIFI protected setup (WPS), then you will have to add network by 'WPS Connect option'. Some home wifi network or secured network require wifi MAC address. In this case, you have first to get the network configured with Wifi MAC address of your mobile. For find your MAC address, follow the given steps:
Settings >> Others >> about Phone >>Status >> Wi-Fi MAC address. Add this address to the secure network, to use wifi on your device.