I use gmail via IMAP and I have 8 years of mail messages synced/stored in my gmail account. You can check your gmail settings to see which one is enabled on your gmail account. A me.com iCloud.com or Mac.com are all the same. They all sync to iCloud.
Does email use iCloud storage?
Mail usually takes up a sizeable chunk of iCloud space. To free up room, Apple suggests deleting what's inside the Junk and Trash folders. But you can regain even more space by deleting attachments from your received and sent mail.2 Feb 2018
Does deleting emails help iCloud storage?
You can free up iCloud space when you delete email messages from your iCloud email account. You can also move email messages from your iPhone, iPad, or iPod touch to your Mac or PC, where they no longer count against your iCloud storage.16 Dec 2021
Do emails backup to iCloud?
Your iPhone, iPad, and iPod touch backups only include information and settings stored on your device. Some information is not included in an iCloud backup but can be added to iCloud and shared across multiple devices like Mail, Health data, call history, and files you store in iCloud Drive.4 Feb 2021