Please see the pic below which is Self-explanatory for Gmail Account for other accounts please read below.
If you use an Exchange account, you can choose to store draft, sent, junk, and deleted messages on the server, and when to erase junk and deleted messages.
On other email accounts, choose Archive instead of deletion.
Settings > Mail > Accounts > [Tap and open the email]
Outlook / Exchange: Tap on Account > Advance Settings > Check what you need to delete Mailbox or Archive Mailbox
[Move Discarded Messages into]
Gmail / Yahoo / AOL: Tap on Account > Advanced > Check what you need to delete Mailbox or Archive Mailbox
[Move Discarded Messages into]
iCloud: [Scroll Down] Under Advanced Section: Mail > Advanced > Check what you need Deleted Mailbox or Archive Mailbox
[Move Discarded Messages into]
What you check here is what you get when you swipe left on an email message.