Yes, and capacitor that goes in parallel across the power supply terminals of anything is called a bypass capacitor. The value....that's really up to you. Try to pick a larger value since it will better smooth *large* motor voltage spikes. Larger capacitor values also filter out low frequency noise better.
The capacitor you use should be rated for at least 2x the voltage the motor is running off on. 4x is preferrable. Otherwise the voltage spikes from the motor will destroy your capacitor very quickly.
Here are some things you should know:
-If you just need the capacitor to filter out motor noise, they can be quite small.
-However, if the capacitor is for a motor controller (to take pressure off the battery and provide power when there are voltage dips), then your capacitor will have to be much larger. For example, the 24V 20A motor controller I have in front of me here uses a 2200uF capacitor. I personally would have used a 4700uF capacitor. I am building a 24V 100+ amp motor controller and plan to use a HUGE capacitor (probably overkill) between 1F and 250mF.