Why does my PC sometimes power down when I shock myself on my desk?
Static discharge can cause a short which will trigger your power supply to automatically flip off.
If you are getting a lot of static in your environment, you may want to think about getting a humidifier. We had to do that for our old office. We were literally discharging every time we touched a wall or a light switch or touched a case. A humidifier will keep the air from getting too dry, and will drastically reduce the amount of static build up.
Edit:
With what you say about this only happening recently, you may want to check and make sure that all your connections are good. If you have some loose connections, especially wires that may be brushing up against the case itself, it may make it more susceptible to static discharge causing it to short out.
You may be able to reduce the likelihood of this happening by grounding the metal parts of your keyboard tray. You don't need real heavy wire, I would probably just use 18 AWG. You may also be able to get away with just wrapping one end around a screw on your computer case.
If you start getting a strong shock, you may be able to put a low ohm resistor in-line with the wire.
Before doing any of this, make sure your outlet, and computer case are well-grounded.