For POP accounts
Launch Mac Mail
Choose Mail > Preferences, click Accounts, select the account, click Advanced
Make sure the box next to "Remove copy from server after retrieving a message" is checked. You can also remove messages currently saved on the server by clicking the "Remove now" button.