Log into your Gmail account and open the Settings page with the little gear button. Click on the Forwarding and POP/IMAP tab and make sure IMAP is enabled and click on save changes.
Open Outlook 2016 and go to the File tab.
Then, just above the Account Settings button, click Add Account.
Select Manual setup or additional server types.
Now, on the Choose Your Account Type step, select "POP or IMAP".
Add your user information and your host server information,
Account type: IMAP
Incoming mail server: imap.gmail.com
Outgoing mail server (SMTP): smtp.gmail.com
Then add your logon information as shown below.
Go to More settings and select the Outgoing server tab. Check the box next to My outgoing server (SMTP) requires authentication and select the radio button next to Use same settings as my incoming mail server.
In the same window go to the Advanced tab and verify the following.
Incoming server (IMAP): 993 or 143
Incoming server encrypted connection: SSL
Outgoing server (SMTP): 465 or 587
Outgoing server encrypted connection: TLS or Auto
Click OK when finished.
Click Next.
If you've entered everything correctly, both testing tasks will be completed successfully and then you can close that little window and again click Next.
You'll get the "You're all set!" message,
Click Finish.
And now you can check your email and "subscribe" to imap mailbox folders through Outlook 2016.