Problem in simple LED Blinker Circuit using PIC16F877A
Leave VDD unconnected from the programming header and connect the microcontroller VDD pins to your power supply. You are now shorting the power supplied from pickit and your own circuit. When the programmer is not present you are no supplying to the other VDD pin.

You get "shocked" because the power supply you are using probably doesn't have grounding connection and is leaking half of the mains voltage through bypass caps to the output (common mode in +12 V and 0 V pins).