Test after taking each of the following steps. Back up all data before making any changes.
1. Make sure the network is on the preferred list by following these instructions. It's important to read the article carefully, as it's the starting point for any further efforts to solve the problem. If you skip any of the steps, the problem may not be solved.
2. Follow the instructions in this support article under the heading "Symptom: The network connection drops unexpectedly."
3. Make a note of all your settings for Wi-Fi in the Network preference pane, then delete the connection from the connection list and recreate it with the same settings. You do this by clicking the plus-sign icon below the connection list, and selecting Wi-Fi as the interface in the sheet that opens. Select Join other network from the Network Name menu, then select your network. Enter the password when prompted and save it in the keychain.
4. From the Location menu at the top of the Network preference pane, select Edit Locations. A sheet will drop down. Click the plus-sign button to create a new location. Give it any name you want. In the new location, set up the Wi-Fi service with the same settings you used before. Click Apply and test.
5. Launch the Keychain Access application. Search for and delete all AirPort network password items that refer to the network. Make a note of the password first.
6. In some cases, the problem has been resolved by repairing permissions on the startup volume.
7. Reinstall OS X.