Control speed of DC Motor with potentiometer

What is a PWM pin?

analogWrite() commands only work on arduino pins that support PWM because internal timer support is needed and they are only 'hardwired' to specify arudino pin numbers, depending on what processor chip your board uses (Mega board has more timers then Uno board). The arduino reference page for analogWrite command tells which output pins will support PWM: http://arduino.cc/en/Reference/AnalogWrite

What is diode correct place? Have you a detailed example for a beginner?

Look at the below linked drawing of controlling a solenoid and see where the diode is wired and which direction the diode is to be wired, it's the same for a simple single winding DC motor: Arduino Playground - HomePage