There is no such thing possible till day. as Graham Hill said that you can use two layer authentication, mean when u login a code will be sent to you on mobile and than you have to enter that code and than you can see the inbox.
Well apart from this Gmail is continuously capturing the location from where u loggged in. And benefit of this is if someone have got your password even that he will not be able to login. Google will deny the Hacker to login as the location is changed. But there is still an option that Hacker is living beside you. Mean your account is compromised by someone close to you. in that case Gmail cannot do anything.
Another scenario is users are infected with some remote administration tools commonly known as RAT. Even than you have no solution.
Conclusion
Hackers are looking for human errors. Systems are Secure by nature. You need to be more cautious and more aware and keep your apps updated.