It could be a problem with your internet provider. Read this article. If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network - Apple Support
If your are using Airport, try this. How to reset your AirPort base station - Apple Support
You might also test with a different location. How to use network locations on your Mac - Apple Support