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).
The Working Voltage is another important capacitor characteristic that defines the maximum continuous voltage either DC or AC that can be applied to the capacitor without failure during its working life. Generally, the working voltage printed onto the side of a capacitors body refers to its DC working voltage, (WVDC).
The voltage rating is the maximum voltage that a capacitor is meant to be exposed to and can store. Some say a good engineering practice is to choose a capacitor that has double the voltage rating than the power supply voltage you will use to charge it.
Remember that capacitors are storage devices. The main thing you need to know about capacitors is that they store X charge at X voltage; meaning, they hold a certain size charge (1µF, 100µF, 1000µF, etc.) at a certain voltage (10V, 25V, 50V, etc.). So when choosing a capacitor you just need to know what size charge you want and at which voltage.
The normal working range for most capacitors is -30 o C to +125 o C with nominal voltage ratings given for a Working Temperature of no more than +70 o C especially for the plastic capacitor types.
For the capacitor to charge up to the desired voltage, the circuit designer must design the circuit specificially for the capacitor to charge up to that voltage. 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.