If you'd like an option to automatically archive messages after you've sent replies:
- Click the gear icon and choose Settings.
- In the General tab, locate the Send and Archive setting and choose the option you prefer.
- Click Save Changes at the bottom of the page.
Once you enable the setting, you'll see a new button at the bottom of the page when you reply to messages. When you're done writing, click Send & Archive to send the reply and archive the previous message in one step, or click Send to send your reply but leave the original message in your inbox.
Reference - Google Online Help - Gmail - Archive