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 charge to near the supply value.
Energy stored would depend on capacitance value.
Would be suited only to device drawing minimal amounts of current, like chip memory etc.
Then again, depends on what you have in mind.