This is mostly guess work based on how the Mail app behaves:
Depends on whether you have GMail set up as Exchange or IMAP.
If you have it set up as Exchange it stores stuff for the number of days you set in the account's Mail Days to Sync settings. If you have it set up as IMAP it is controlled by the Show settings in Mail, Contacts, Calendars.
Emails beyond these settings are loaded (if available) by choosing the Load More Messages link at the bottom of the email list.
Attachments download automatically if they are under a certain size (500 MB) I think. Otherwise they show up with a dotted line around them. You tap them to start the download. So large attachments take no space, until you want them. Then, of course, they are there until you delete the email.
Folders are harder to predict. The obey the same rules as the Inbox when you open them; but unless you've set them up to Push (possible in Exchange) they do not download until you open the folder. I know they occasionally purge, because when I open a folder that has not been opened in a long while it is empty, then shows that it is downloading. I don't know how long, or what action purges the folder. Simply removing Mail from RAM or restarting the iPad does not do it.
At any rate, the iPad does not store all your mail indefinitely. There are limits to how much it will keep on the iPad, and you are in at least partial control of that.
I hope that helps.
{I did not cover POP accounts because I don't have one. I'm pretty sure how it handles things, but would rather leave that to someone who knows for sure)}