You can determine the right size in one of three ways,
1 Guess: Guess the value by experimentation and guessing. 2 Follow the circuit: If you are making something from a schematic then use the marked capacitor value. 3 Work it out: If you are not following a schematic then make an guess based on the rest of the circuit.
5 watts of power for 1 second is 5 joules of energy. E = (1/2) C V^2
C = 2E/V^2
C = 2*5 Joules/(12 volts)^2 = 0. 0694 Farads
Those should be the basics of your measurement.
The size of the capacitor is depend on the charge storing capacity of the capacitor,dielectric material and mainly spacing between the two conductors that is separated by the dielectric medium. And the type of capacitor i. e, variable one or fixed. the charge stored in the capacitor is depend on the spacing between the conductors that is seperated bydielectric medium.