4.4.4 How to Protect My Code After It Is Programmed Into a Device?
Many devices with flash program memory allow all or part of this memory to be write protected. The device Configuration bits need to be set correctly for this to take place. For more on using Configuration bits, refer the following sections:
24.4.14 Specifying Configuration Bits (CCI)
Your device data sheet is also a good resource for this question.