DC Motors convert electrical energy (voltage) to mechanical energy (produce rotational motion). The Dc motor works on the principle of Lorentz force which states that when a wire carrying current is placed in a region having magnetic field, than the wire experiences a force. This Lorentz force provides a torque to the coil to rotate.
Speed of motor depends upon its RPM rating and we can vary the speed of motor by changing the voltage across the motor terminals. Gears are used to increase the torque of D.C Motor at the expense of its speed.