anotherdrew is right. Just to help recognize, a 3-pin female (with 3 holes) fan connector is 8mm wide and has two ridges running down one side. When you plug it into a mobo header, the header has a plastic "tongue" sticking up beside the first 3 pins, and the connector ridges slide on either side of this tongue. There is only one way to plug it in. A 4-pin fan has a slightly wider body with 4 holes, but the same side ridges. If you connect this way, the mobo header can control the speed of the fan automatically for you as your workload changes (but see last paragraph).
A 4-pin Molex connector IF your fan has one on its wires is much wider - about 18 to 20 mm - and contains four round pins nestled inside a shroud. It plugs into a Molex female (with 4 holes) output from the PSU. If you connect this way there is NO speed control - the fan will always run full speed.
SOME fans come with BOTH of those connector types on its wires. This is only to allow you to use it with either type of power connection. BUT in these designs, you must choose ONLY ONE connection, and NOT use the other.
The method of controlling fan speed is differnt between 3- and 4-pin fans, but they have been designed for some compatibility between them. You can plug either fan connector into either type of header and it will work, sort of. The one mis-match that does not work fully is when you plug a 3-pin fan into a 4-pin header that is actually using the new PWM Mode for control. In that case there is no speed control and your fan will always run full speed. HOWEVER, MANY mobos now use only 4-pin headers but allow YOU to choose which control methood the header uses. This is done using the BIOS Setup configuration screens for each fan header. IF you have any 3-pin fans plugged in, go to the fan header that fan uses. Look for an option to select either Voltage Control Mode (aka DC Mode) or PWM Mode. Use DC Mode for a 3-pin fan, or PWM Mode for a 4-pin fan.