Here is a step by step procedure how you can enable this security feature on your account
1 ) Login to your gmail account
2 )
Go to settings on the top right
3 )
Now go to the Accounts and Import tab
Click on Google Account settings option
Once you select your phone on the new screen type your mobile number and click send code button as shown in the image above,type in the code that you got in your mobile and click verify button
9 )
Now we have successfully configured our phone with the google account to get codes but before we can turn on the verification we need to add backup incase we want to access our account when we dont have the phone nearby so lets click on next
10 )
On next screen it will display 10 codes that you should print it out for future use,these are the backup codes incase your phones arent available,now lets add a backup phone number as well so click next
11 )
Here type in your backup phone number then click next as shown in the pic that you can use later on if anyhow you dont have the primary phone with you or the printed backup codes
12 )
On the next screen it will show you what all applications are there in your account that cant ask for verification code and you need to enter an application-specific password that you can create later,click next
13 )
Here just click the Turn on 2-step verification blue button
14 )
Once you do that you will see a pop up saying you would be signed out from your google account on all devices,click ok
15 )
Now it will ask your user id and password to login to your account then you need to type in the code that will be sent to your mobile and click verify,if you wish you can uncheck the Remember verification for this computer for 30 days so everytime you will get a new code on your mobile device even while you login from the same computer choice is yours,if you wish more security simply uncheck it
16 )