Google Talk uses certain ports to communicate. It could be that the Wifi network you are connecting to does not allow communication on those ports. This happens to me when i'm at work. Since those ports are closed, i cannot use Gtalk on wifi when at work. However on my home wifi, i can login with no issues.