First, check the strength of the WiFi signal on your mobile or table (make sure that you see at least two bars on the WiFi indicator on your screen). Try getting closer to the WiFi hotspot to improve the WiFi signal reception. It's also possible, specially at public WiFi access points, that there are people connected at the same time as you. Wait a few moments, try again and if you still can't connect, find another WiFi hotspot nearby in the map and may be less busy.
In the case of private WiFi hotpots in the Fon network, it's possible that the WiFi signal does not reach street level. l.