The significant advantages of permanent magnet synchronous motors, such as very good dynamic properties, high efficiency and power density, have led to their frequent use in many drive systems today. However, like other types of electric motors, they are exposed to various types of faults, including stator winding faults. Stator winding faults are mainly inter-turn short circuits and are among the most common faults in electric motors. In this paper, the possibility of using the spectral analysis of symmetrical current components to extract fault symptoms and the machine-learning-based K-Nearest Neighbors (KNN) algorithm for the detection and classification of the PMSM stator winding fault is presented. The impact of the key parameters of this classifier on the effectiveness of stator winding fault detection and classification is presented and discussed in detail, which has not been researched in the literature so far. The proposed solution was verified experimentally using a 2.5 kW PMSM, the construction of which was specially prepared for carrying out controlled inter-turn short circuits.