My new MacBook Pro won't keep its Wi-Fi connection
Are you on OS X 10.10.1? It claims to fix some wifi issues present in 10.10.0.

If your software is up to date, you can try the following steps. They worked perfectly on my early 2011 MBP running Yosemite. Source


Turn off Wi-Fi from the menu bar.
From Finder, hit Command+Shift+G (or click Go > Go to Folder) and enter the following path:

/Library/Preferences/SystemConfiguration/

Within this folder, locate and select the following files. (Note: You may not actually have all of them. I know I didn't have all five files on my computer, but I deleted all the ones I had and the fix still worked!)

com.apple.airport.preferences.plist
com.apple.network.identification.plist
com.apple.wifi.message-tracer.plist
NetworkInterfaces.plist
preferences.plist

Move them to a backup folder, like on your desktop. The goal is to delete them from the SystemConfiguration folder (so make sure they don't exist in that folder any more!) to force OS X to recreate them, but you'll want to be able to put your original files back in there in case something goes wrong.
Reboot your computer.
Turn on Wi-Fi from the menu bar. Good luck!