If you have two-factor authentication turned on, see the following from Two-factor authentication for Apple ID - Apple Support
When you sign in on a new device, you’ll get a notification on your other trusted devices that includes a map showing the approximate location of the new device. This is an approximate location based on the IP address the device is currently using, rather than the exact location of the device. The location shown might reflect the network you're connected to, and not your physical location.
If you know you’re the person trying to sign in but you don’t recognize the location shown, you can still tap Allow and continue signing in.
However, if you ever see a notification that your Apple ID is being used to sign in on a new device and you're not the one signing in, tap Don’t Allow to ensure the sign in attempt is blocked.
If you don't have that turned on and you are getting messages about someone signing in from other locations, you may want to be very careful to verify that the email notification is from Apple and is not an attempt to get you to use a link in the email and divulge your password or other information.