That's more like a block diagram that a circuit diagram!, I'm presuming there's a lot of parts that you're not showing?.
We need to see the exact circuit, as you have it connected, including the power supply, and all decoupling capacitors - everything!.
As you show the motor being fed from +5V, I'm presuming that you are using the same supply as the PIC?.
If your power supply uses a 7805 regulator, as soon as the motor turns ON it's liable to draw more than the 1 amp maximum the regulator will provide - so the +5V rail will fall drastically, the PIC will reset, and the motor will stop again. It's advisable to feed any heavy current devices from a different supply to the micro.
This is why we need the FULL circuit, instead of just guessing!.