It depends on what kind of Pi model you have and your expectations. With a Raspberry Pi 5 you have a built in RTC and can connect a battery, that will keep the date and time accurate when when the Pi is powered off.
You can add a RTC to other models also but that include adding hardware and a battery.
If you wish to keep the date and time accurate you can sync it against precision clocks on the internet via NTP (Network Time Protocol). Install ntp,
udo apt install ntp and you can also tweak it so it uses the closest geographically by changing the NTP source to a close NTP Pool, check
https://www.ntppool.org/en/