could you post which board are you using?
when some circuit works with the pickit connected, and stop working when disconnected, it could be one of 3 things:
1. MCLR is left floating... common in cheap boards or newbie mistake... add a 10K resistor in MCLR to VCC as pull-up.
2. Power SUPPLY issues... maybe you are powering from the pickit and after disconnecting there is some drop voltage or so... also it could be a missconnected 0V - GND fault, please, if you are connecting the board to the PC via a serial link, don't forget to check the GND cable from th serial port to GND(0v) from the board)
3. finally leftover pins, the pickit uses 2 or 3 pins to program the microcontroller, specifically RB7 and RB6, if you are not using this pins in your program, maybe it mess that you are leaving them floating, add 2 resistors or enable the internal pull-up.