Common working DC voltages are 10V, 16V, 25V, 35V, 50V, 63V, 100V, 160V, 250V, 400V and 1000V and are printed onto the body of the capacitor.
One very important rating of capacitors is "working voltage". This is the maximum voltage at which the capacitor operates without leaking excessively or arcing through. This working voltage is expressed in terms of DC but the AC equivalent is about only one half of that DC rating.
A capacitor may have a 50-volt rating but it will not charge up to 50 volts unless it is fed 50 volts from a DC power source. The voltage rating is only the maximum voltage that a capacitor should be exposed to, not the voltage that the capacitor will charge up to.
Once it's charged, the capacitor has the same voltage as the battery (1.5 volts on the battery means 1.5 volts on the capacitor). For a small capacitor, the capacity is small. But large capacitors can hold quite a charge. You can find capacitors as big as soda cans that hold enough charge to light a flashlight for a minute or more.
So if a capacitor is going to be exposed to 25 volts, to be on the safe side, it's best to use a 50 volt-rated capacitor. Also, note that the voltage rating of a capacitor is also referred to at times as the working voltage or maximum working voltage (of the capacitor).
To be sure, the battery puts out energy QV b in the process of charging the capacitor to equilibrium at battery voltage V b. But half of that energy is dissipated in heat in the resistance of the charging pathway, and only QV b /2 is finally stored on the capacitor at equilibrium.
What is the difference between a capacitor and a battery?
The only difference is a capacitor discharges its voltage much quicker than a battery, but it's the same concept in how they both supply voltage to a circuit. A circuit designer wouldn't just use any voltage for a circuit but a specific voltage which is needed for the circuit. For one circuit, 12 volts may be needed.