If you are planning to switch frequently between using a desktop IMAP client and the Google web app (GWA), we recommend the following configuration:
Make sure the All Mail label, which holds Archived messages, is checked for Show in IMAP within your Google Web App "Labels" settings (see configuration guides for more details).
The downside of this configuration is that your client will download and store a duplicate copy of your messages: one for any folder corresponding to any label that's applied to a message, and one for the "All Mail" folder. A ramification of this approach is that it will take longer to sync your messages.
If, on the other hand, you are NOT planning to use the Google Web App, or plan to use it only sparingly, we recommend the following configuration:
Make sure the All Mail label, which holds Archived messages, is NOT checked for Show in IMAP within your Google Web App "Labels" settings.
The downside of this configuration is that any messages that are archived in the rarely-used web client WILL NOT BE VISIBLE within your desktop client. The upside of this is that your client will sync faster, since it will not have to handle duplicate copies of your messages.
You can also disable the Important label from appearing in your desktop IMAP client by UNchecking the Show in IMAP box. The Important label is used by the Google Web App and is not needed for desktop IMAP clients.