There are various triggers for this sort of thing.
The first is a bad password or bad username. Mail.app > Mail > Preferences... > Accounts > select the account > choose the Outgoing Mail Server (SMTP) to Edit SMTP Server List > choose the SMTP server that's giving the password problem > Advanced > Enter the correct user and password for the SMTP server.
The password error can also sometimes be triggered with network outagss; your network or the connection to the mail server.
And the SMTP server settings can be incorrect. Check with your particular mail ISP for details on the set-up; the specifics (host name, using SSL or not, etc) vary by provider.