Credit:
To turn the feature on, click on settings in the upper right corner of Gmail, scroll down and choose whether you want to be notified of chat messages, e-mails, or only important e-mails.
The new feature is HTML5-based and currently works only in Chrome, but Google says it's working to make notifications part of the standard web platform.