When a computer freezes after running X-Plane for awhile, the problem is almost always heat related. When the system is running X-Plane, the video card and processor get very hot because they are running at 100% utilization. This causes the temperature to rise inside the case. To eliminate heat as an issue, remove the computer’s cover and aim a fan into the case. Run X-Plane for a while and see if the problem goes away. If it does, then you need to add some additional cooling.
Note that this assumes that the system has enough RAM. Running out of RAM will cause crashes as well. At least 2 GB of RAM should be used for current versions of X-Plane. This also assumes that the computer is not overclocked.