When do capacitors "decide" to discharge?
Capacitors oppose changes of voltage.

If you have a positive voltage X across the plates, and apply voltage Y: the capacitor will charge if Y > X and discharge if X > Y.


  calculate a capacitance value to discharge with certain voltage and current values over a specific amount of time


There's the classic RC circuit analysis which should be taught right at the beginning of learning electronics.