You can prevent this by:

1. Using Gmail web main interface on the same computer device (as Gmail would probably use the cookies or any other information related to your computer);
2. setting up your Gmail account as internal email account (either POP3 or IMAP) in the Mail program of your computer;
3. using Gmail App for smart phones or a tablet version (or any 3rd party application synchronised with Gmail).

I think those are the ways that would allow you to avoid this annoying security checks. I hope that the options listed above will help.