I was able to connect to Wi-Fi easily at home. However, when I tried to connect over someone else's house, I chose the name of their Wi-Fi router & put in the correct password for their Wi-Fi & nothing happened. It simply would not connect. I tried updating & upgrading the Pi 3 but that did not help. Thank you for your help
My first attempt would be to list all available hotspots. This can be done via
sudo iwlist wlan0 scan
When you can see the hotspot you want to connect check if the provider uses DHCP or static IP addresses and if it matches your configuration.
The last thing I can think of would be the usage of hidden SSIDs. Then you have to include 2 settings.
Just to check - here is the configuration that I use:
iface wlan0 inet dhcp
wpa-ssid "name of hotspot"
One more thing: if the authentication is not WPA or WPA2 you have to specify it as well. I think this case is rather obscure. You can see the authentication in the result of the scan.