Hi,
Number of poles = 120 * frequency / RPM. Frequency is in Hz or cycles per second.
Rotate motor at known RPM. Measure frequency of the signal generated on motor phase leads with frequency meter or oscilloscope.
Or, apply known frequency to motor leads and measure RPM. Then use above formula.
Magnetic poles only come in pairs. So you will necessarily have an even number, ie. 2, 4, 6, ... 18, ... 40, etc.
major