The PWM period is specified by writing to the PR2 register. PWM frequency is defined as 1 / [PWM period].

The PWM duty cycle is specified by writing to the CCPR1L register and to the CCP1CON bits 5 & 4.

Whatever values you place in these registers stays there until you put something else there or a hardware reset clears everything back to the power-up defaults.

CCP1CON = 12 turns on PWM
CCP1CON = 0 turns it off

All you need to do is write to CCP1CON to turn hardware PWM on/off. It's going to come back on at the same frequency & duty cycle you had it setup for originally, and stay there until you write different values to the control registers or a hardware reset.