Capacitor sizing for small motors to reduce inductive voltage spikes
Each motor should have a small ceramic capacitor (10-100nF) across it to reduce RF (Radio Frequency) interference caused by brush arcing. A popular configuration is two 100nF capacitors in series, one from each motor terminal to the metal case. This 'grounds' the case to RF to prevent it from radiating interference, but doesn't put a DC voltage on it.

This small capacitance will not prevent inductive voltage spikes. If PWM is applied then you must not use a large capacitor, as this will become charged up and prevent the voltage from dropping between PWM pulses.    

Your motor controller should have 'flyback' diodes in it, which suppress inductive voltage spikes by recirculating current through the motor. This is required not only to prevent damage to sensitive electronic components, but also for efficiency and linear PWM response. The diodes should be Schottky type for fast response and low voltage drop. 

If the motor is only driven in one direction then a single flyback diode can be wired directly across it, but this is not possible in a bidirectional bridge circuit because in one direction the diode would short out the motor. Therefore a bridge circuit needs 4 diodes, one across each output transistor. MOSFETs already have built-in body diodes, so external diodes are not normally required for them.  

You should also have a large low ESR capacitor (100~1000uF) across the controller's power input rails, to suppress voltage spikes caused by inductance of the power supply wires. If the controller does 'active freewheeling' AKA 'synchronous rectification' and/or dynamic braking then this capacitor also helps to slow down the voltage rise caused by the motor pushing current back into the battery as it slows down.