Some Mac OS X computers will lose time synchronization even when the "Set date & time automatically" option is selected in the Date & Time preference pane. To temporarily resolve the issue, simply deselect and then reselect that checkbox.
To permanently resolve the issue, you can modify the default values in the time synchronization configuration file. The defaults require several hours of constant access to the time server in order to establish synchronization. If the initial sync gets interrupted (by the computer going to sleep, for example), the subsequent synchronization will not take place, causing the computer to eventually drift from the correct time.
Note: Modification of the configuration file is an advanced technique. If you are not experienced in the type of steps you see below, consider using the temporary method mentioned above. The advanced steps will use the pico text editor as an example; advanced users may choose a different editor.
To modify the configuration file, follow these steps:
sudo cp /etc/ntp.conf /etc/newntp.conf
sudo pico /etc/newntp.conf
server time.apple.com iburst
sudo pico /System/Library/StartupItems/NetworkTime/NetworkTime
ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid -c /etc/newntp.conf
sudo SystemStarter -d restart "Network Time"
Note: These changes will help Mac OS X establish time synchronization quickly. Time drift may still occur if the computer's network configuration changes. To re-establish synchronization, restart the Network Time service as described in the last step above.