You will have to sign into Gmail on your phone using a special app password which you can find by signing into Google on your computer and accessing your Security settings.
Under Signing into Google, select App Passwords. You will need to enter your password again.
Set up a new app password for Mail by selecting "Mail" on my "iPhone" (or other iOS device) in the dropdowns and click "Generate". You will see a unique password and some instructions for set up. Follow those instructions or use the ones below to complete set up.
On your iPhone:
Open “Settings” on your iPhone.
Select “Mail, Contacts, Calendars”.
Select your Google Account from the list of available accounts.
Edit your account information and replace your password with the 16-character password.