PWM or pulse width modulation is a method used for reducing average power provided by a source by effectively dividing it into discrete parts. While a potentiometer is essentially a variable resistor having three terminals.

This video illustrates the difference between both and when you should use a potentiometer and when you should employ PWM.