Your PSU is not quite adequate, you'de best be with at least a 550 watt PSU. Also, if you POs is later than Windows XP like Vista or Windows 7, then you are better of with more ram like 4gb, even if you are still using only x32, you don't get to use the whole 4gb but as much as 3.5gb which is better than 3gb or 2gb.
Make sure you got adequate ventilation, the Pc is not in an enclosed area (or against a wall blocking the exhaust output from dissipating) and that your thermal paste is between the CPU and heatsink is adequate (too much will create an insualtor film rather than a dissipator reaction) and that the CPu is covered entirely and not just a splotch in the middle.
Even in saying all that, the PC should not just shut down, even with a 400 watt PSU. It's possible that you might be running Windows 7 (x32 or x64)on a PC platform more designed for Windows XP or Vista at most.