mail.app rejecting correct password for gmail accounts
The fix is to login to the google account affected, and then go to https://www.google.com/settings/security/lesssecureapps and select "Enable" for the question "Access for less secure apps."  

Apparently this results from a change Google made several months ago to improve security, which is indeed becoming more and more important as Google accounts are tied to a wider and wider range of uses.  It is a mystery to me why it suddenly prevented my logging in now, but I wanted to share the solution I found in case anyone else encounters the same problem.