Yes, to a degree, but why would you need to?
Capacitors store a charge ( value can be calculated) but they also "leak" the charge over a period of time.
The time is dependant on many things.
As to how, the cap (usually electrolytic type) is basically connected to a source of dc supply.
It will...