Usually when connection timeout occurs, you can attempt the following common solutions.
- Turn off WiFi and turn it back on.
You can try resetting the connection information for your router by "forgetting" the router information:
- Go to System Preferences > Network: Wifi -> Advanced.
- Remove your Preferred Network.
- Rejoin network.
You can try resetting your router:
- Unplug your router and plug it back in after 10-20 seconds.
You can't transmit on the same channel as other wifi networks. If there is a conflicting router, it may be taking precedence over your router.
- Go to About this Mac -> More Info... -> System Report -> Network: Wi-Fi
- If your router is running on the same channel as other networks, try changing that:
- Plug in via ethernet or try getting closer to your router...
- Connect to your router (IP is located in the connection information in your Network preferences)
- Change the Router channel to a channel that's not being used by other networks around you.
- Restart your router.
If the above still doesn't work, a corrupt entry in your keychain may be the culprit:
- Go to Keychain Access
- Find all the entries that match your router.
- Highlight all matching entries and delete them.
If the above still doesn't work, try some of the troubleshooting tips from here: Wifi Dropping in OSX Lion - Fixes
If all else fails, upgrade to Mountain Lion. That will solve everything. :)