For a small motor my rule of thumb is to make the maximum pulse width of a given f and d.c. 10% of the L/DCR = Tau time constant. This puts it in continuous conduction mode (CCM) using the motor L as a RL low pass filter.
However aliasing noises in the magnetics on different RPM frequencies of brush noise and switching frequency and if too low fSW then motor jitter occurs. Also sometimes e-caps are used to smoothen ripple and noise as long as it is bipolar. Then the Q of SRF must be examined.... To keep it well damped.
Going too fast at high currents starts to encroach on the SOA limits so this must be reduced as the current is still flowing when the switch voltage increases. Often in the audio band such as for cordless drills.
So you can measure or choose just under or about 20kHz for now or measure L/R and compute Pd in the switch from the turn off decay current pulse.
With BLDC motors PWM might interfere with the Hall sensors electronics such as in variable speed fans, so it gets more complex and this why PWM fans are designed to support this rather than treat all CPU fans as PWM controllable via power.