PSU problem

My HP desktop runs fine for 0.5 to 2 hours then stops.

Not shut down just switches off.

I replaced the PSU but still have the same problem.

What do Ido next?