When you enable two-step verification on a Gmail account you then need to generate an application specific password for each program you want to access your account. This will be different to your normal Gmail password (which will no longer work on it's own)
To do this log into your Gmail account and then go to the Google account settings.
Type in a name for the application then click the 'Generate password' tab. Copy the generated password and put it in the password box for the application you wish to use with your Gmail.
More information can be found from Google here