Since Gmail is one of the most widely used email services, it becomes automatically one of the most sought after target for hackers. However, you can easily find out if your Gmail account is being accessed without your knowledge from within the Gmail window itself.
Just go to the inbox and scroll to the bottom of the page. Look for the line that says “Last Account Activity” and click on details. A new window will open with IP addresses used to access your account in the past 12 hours. You can check if there is any unknown IP and even set Gmail to alert you if there is an unusual activity. From here, you can also sign-out all other open sessions of your account in any other computer or device.
One of the best ways to foil hackers is to frequently change your password and make it as strong as possible.