The Mail app in macOS is like most other email clients, letting you add email accounts from your favorite email provider so that you can send and receive email with ease. Of course, this means you can access your Gmail account through Mail, too.
When you use Gmail on your Mac, you can configure whether you access your online account through IMAP or POP.
Directions
Go to the Mail menu and choose Add Account... from the options.
Select Google in the Choose a Mail account provider... screen.
Click Continue.
Type your Gmail email address when asked, and then click NEXT.
Type the password to your Gmail account in the space provided, and then click NEXT.
If you have two-step authentication enabled, enter the code received by SMS or generated in an authentication app, and then click NEXT.
Make sure Mail is checked as one of the apps to use with your account.
You can pick others, too, like Calendars or Notes, but that's not necessary in order to sync your mail.
Click Done.
If you're using Mail 7, the steps are a bit different.
Select Mail > Preferences... from the menu in Mail.
Go to the Accounts tab.
Click + (plus sign) under the accounts list.
Make sure Google is selected under Choose a mail account to add….
Click Continue.
Type your full name under Name:, and your Gmail address under Email Address:.
Enter your Gmail password when asked to.
Type the code you received if you have two-step authentication enabled for your Gmail account. You can also use an app-specific password to log in, but you don't have to.
Click Set Up.
Make sure Mail is checked under Select the apps to use with <your email>.
If you want, you can also sync your other Google information like contacts, calendars, and notes.
Click Done.
If Gmail doesn't work on your Mac after trying to set up the account, and you've already enabled IMAP access, you might need to modify the email server settings in Mail. Using IMAP with Gmail requires the IMAP server settings. To use Gmail via POP requires that you enable POP through your Gmail account. If you do that, you might also need to enter the Gmail POP server settings in Mail.
Other Ways to Access Gmail
Mail isn't the only program that can access Gmail on a Mac. In fact, lots of free email clients for Mac can be used to download and send email through your Gmail account. However, the setup instructions for those email clients are not the same as the steps above. They are, however, very similar and require the same IMAP and POP server information linked above.
Of course, another way to get to Gmail on your Mac is to access Gmail.com. When you send and receive Gmail messages through a browser via that URL, you don't need to worry about email server settings or downloading anything. It works in Safari and other web browsers you might use.