When I click delete on an email (gmail) in Windows phone, not only does it not archive the email (which is what I'd prefer) but it doesn't even delete it when I go check my email back in gmail website. All it does is hide it inside the phone but it's not really deleted or archived in the account.
After some hours of research I finally found the solution. Through your browser (on Windows Phone) go to http://m.google.com/sync, login with your data and select WP7 device. Now you only need to enable the option: Enable "Delete Email As Trash" for this device. Save and exit.
Now if you delete an email from Windows Phone, this email went correctly deleted in Gmail.
By default, Gmail deletes (moves to the Bin folder) only messages deleted inside Gmail itself or in Gmail program for Android system, that is mail clients that operate directly on Gmail's mailboxes.
Message marked as deleted in any other mail client (which syncs messages with Gmail via IMAP) will be archived by default (moved to the All Mail folder).
Take a look at following screenshot:
This is the default setting, so if you haven't changed it, when you delete a message in Windows Phone (or any other device that uses IMAP to sync folders to Gmail), it will be archived, not deleted.
I have confirmed this by deleting one message from my mailbox in Windows Phone and moving a second one to the [Gmail]/All Mail folder (this operation is equivalent to archiving). Both emails were placed in the [Gmail]/All Mail folder in Gmail, i.e. both were correctly archived.
You can read more about Deleting IMAP messages on Google's support site. To cite Google (emphasis mine):
If you delete a message from your inbox or one of your custom folders in your IMAP client, it will still appear in [Gmail]/All Mail.
Only if you change the above configuration to "Auto-Expunge off" + "Move the message to the Trash" you will achieve the result that deleting mail in an external mail client will result in actually deleting it.