I assume you have Windows. Use some tweaking utilities like ‘Customizer XP’ to ensure that option in registry “Automatically restart Windows when Explorer crashes” is disabled.
After this if the problem goes away… it most likely was a software (OS) problem.
Else one or the other hardware is malfunctioning could be right from SMPS to Motherboard. As you have indicated it’s an old PC, most likely some hardware is on verge of giving up.