How to Configure Wifi on a Raspberry Pi 3

Edit /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "network-name"
    wpa-psk "password"
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Edit /etc/wpa_supplicant/wpa_supplicant.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

Restart the wifi interface

ifdown wlan0
ifup wlan0