mkelly is correct about how to configure Mail with your Gmail account.
However, you'll discover that Mail may not always be up-to-the-second with your Gmail account like your iPhone. In my case, Mail consistently lagged behind no matter what settings I applied. This has been discussed in these forums.
For this reason I am now using the third-party email client "Postbox"(v2). Seems to get "pushed" mail instantly. They have a free version, "Postbox Express", which has less features but seems to get mail instantly, also.