ZerocoolAstra is right. But if the AF mode is on instead of manual, then the lens will not rotate as you screw in the filter.
It can rotate even in AF mode... I can easily overcome the resistance of the AF motor and gears with my hand.
Therefore to play safe (kiasu-kiasi), best to hold the focusing ring firmly with one hand, and twist in/out the filter with the other free hand. This reduces/removes the strain on the gears and AF motor.