A hacker would need access to both of these factors to gain access to your Google Account. If you like, you can always choose a “Remember verification for this computer for 30 days” option. You can also set up one-time application-specific passwords to sign in to your account from non-browser based applications that are designed to only ask for a password, and cannot prompt for the code. When you enter this code after correctly submitting your password we’ll have a pretty good idea that the person signing in is actually you.”]
Source: https://googleblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html

