My friend has a problem. His computer turns off itself time to time. We suspect something is overheating, but we need to check it for sure. Is there some application (for Windows) which can monitor temperatures and store it to disk in realtime, so it is available for reading after the crash?

You could try using PerfMon and some sort of temperature plugin or app that exposes its data to PerfMon.

A quick Google search turned up this app: http://perfmon.vista-files.org/
Apparently it can read by PerfMon. So what you'd want to do is set up the temperature monitoring tool, then set up PerfMon to capture the data and log it to disk. Of course if the tool itself can write the data to disk, you could skip the PerfMon pert altogether.