For most Android phones, the system clock is set using a protocol called NITZ, which relies on a connection with your carrier to ensure that the time stays in sync. The trouble here is that this feature won't work when you're outside of cellular range, and a lot of times, the carriers themselves have technical difficulties that can result in your phone's clock being minutes or even hours out of sync.
I've experienced this issue several times, personally, and it always makes me wish Android's clock would simply sync with official time-keeping services like NTP or NIST. Well thanks to a recent update to a popular Android app, this can finally be accomplished on newer Android versions, meaning you can ensure that your system clock is always in sync with atomic time.
The app that will sync your system clock with atomic time is fittingly called ClockSync, and it's available for free on the Google Play Store.
When you first launch ClockSync, you'll probably notice that your system clock is already at least a couple of seconds out of sync with atomic time. Either way, though, start by tapping the three-dot menu button at the top of the screen, then choose the "Settings" option. From here, you can change the time service with the first option if you'd like, but the first thing you should do is tick the "Enable" box beneath the Automatic synchronization category.
From here, there are additional options for tweaking the synchronization process to your liking, but most users should be satisfied with leaving these set to their default values. Aside from that, to ensure that your clock stays in sync when you're traveling, tick the box next to the "Detect time zone" option.
With all of the options tweaked to your liking now, head back out to ClockSync's main menu. From here, tap the three-dot menu button again, but this time choose "Synchronize." At this point, the app will ask for root access, so tap "Grant" on the Superuser request popup.
Once you've done that, you'll notice that the System time becomes perfectly in sync with the Atomic time being reported by the time service. Since you set the app to automatically update your system clock, this will continue to be the case from here on out, provided your device is connected to either mobile data or Wi-Fi.