When I try to add my gmail account to Lumia 520 by simply adding a Google account or adding it through Advanced Setup, it gives the error msg -Incorrect password for the imap server. But I am able to successfully add another gmail account to the same phone. Also, I could easily add my Facebook account to the phone and get regular notifications, but am not able to connect to Facebook Chat on my phone.
You might need to setup synch settings for your device. Try going to this site from your phone and see how things work after giving the proper permission. https://m.google.com/sync/settings/