The number of pins of a mechanical switch refers to the physical contacts that connect the switch to the board. Different numbers of pins can affect the stability of the switch, its compatibility with different circuit boards, and its ability to conduct signals or backlighting. For proper functionality, it is important to select a switch with the appropriate number of pins for the board type.