If you are going to use Google Apps account in pidgin you have to use a few tricks to make things working:
In Basic tab:
1. Change Domain from gmail.com to yourdomain.com
In Advanced tab:
2. Remove check “Require SSL/TLS” and set “Force old (port 5223) SSL
3. Change “Connect port” to 443
4. Change connect server to talk.google.com
This should do it. Here is a screenshot from my working setup: