Thank you for visiting Apple Support Communities.
Sometimes a simple power cycle of the router can correct the issue that you are experiencing. However, the issue could be a little more complex. Wi-Fi routers need adjustments to settings periodically for optimized performance with the constant progression of wireless device technology. Below, I have included two articles. The first article will cover basic Wi-Fi troubleshooting regarding iOS device connection. The second article cover the recommended settings for current Wi-Fi access points.
If you still can' join your wifi when security is turned on, try click on your wifi's SSID line's "i" in a blue circle, click on "Forget this Network", and it'll ask you for the password again.
If that still doesn't work, connect to your router by a wired connection from a PC or Mac.
Get into the admin page (pls ask me if you need instructions on how to get in to a router),
Use the desktop/laptop computer to scan for strength of all the wifi base stations around you.
Often times the radio channel is set to Auto but sometimes auto doesn't make a good choice, then you will have to pick a channel that is not used by your neighbors.
802.11n mode requires security to be WPA2 AES. Remember, the 802.11n standard took a long time to finalize. Before it became official, there were 802.11n "draft" routers on the market. If you've been using that router for some time, who can remember whether it was n-draft or n-final, or is that company's interpretation of 802.11n the same as Apple's?
Make sure WMM (Wireless Multi-media is enabled). I read in one of the Apple KB docs that after iOS6 Airplay needs this enabled.
If you still can't join after all the above, try typing in a new paraphrase, try a shorter one for the time being.
If all else fails, just go and buy a newer wifi router. They're affordable these days. I was battling wifi stability problems for days until I got a brand new one, no more problems.