Question: How are computers able to tell the correct time and date every time?

Whenever I close the computer (shut it down) all connections and processes inside stop. How is it that when I open the computer again it tells the exact correct time? Does the computer not shut down completely when I shut it down? Are there some processes still running in it? But then how does my laptop tell the correct time when I take out the battery (and thus forcibly stop all processes) and start it again after a few days?

Answer: 
If you remove the battery on the motherboard then the computer wouldn't have any way to tell the time.

This is also the case with mobile phones. If you let a phone discharge and then not recharge it for more than a few weeks it will also "forget the time" because the small auxiliary battery is discharged completely and nothing is powering on the real-time clock.

You could try to power on an old mobile phone if you have one and check it yourself to see that it "forgot the time".

This is how the battery looks.
<https://yandex.com/images/touch/search?text=mobo%20battery&source=tabbar>

I had to buy one a few times when mine started to last less then a day. I had to configure the clock everytime i turned on the PC.
When you start Windows, it gains direct access to the memory of the Real Time Clock (RTC) and uses its date and time values to set the computer date and time. Timer interrupts maintain the computer time when Windows is running. A Time Daemon in Windows runs approximately once each hour after the Windows starts. The Time Daemon compares the time in Windows with the time in the RTC. If the two times are more than one minute apart, Windows changes the time and date to match the RTC. You cannot change the time interval for the Time Daemon to run. 

If you use a time synchronizing service, such as the TimeServ.exe tool included with the Windows NT 4.0 Resource Kit, the tool updates the time in Windows and the computer's RTC.
If the Windows Time Service runs on a Windows 2000 based-computer, the Time Daemon in Windows cannot run approximately one time each hour after the Windows starts.

For more details visit this link:<http://msdn2.microsoft.com/en-us/library/ms724936.aspxhttp://msdn2.microsoft.com/en-us/library/ms724942.aspx>