There are several reasons this might be happening and there are several ways to solve the problem. First of all the simplest solution is just a reboot your phone but that might be a bit drastic. Usually that will solve the problem.
Another option is to remove the network settings for that network. Just delete it or have your phone "forget" the settings and then reapply them. And often that fixes the problem.
If neither of those solves the problem another solution is to politely ask the owner of the network to reset the wireless router. In my case when nothing else works that generally does.
But it means kicking everyone off the network and it's awfully impolite. But one of those solutions ought to fix your problem. If nothing else works you can also try resetting your phone's network settings in general but that forgets all of your wireless networks and means you will have to reapply all of the Wi-Fi password that you had stored in your phone. Try some of these and see if any of them will work for you.