in general i go 125% of normal conditions voltage for capacitors, for transistors i generally keep 15V minimum higher than the highest expected voltage under normal conditions, and with diodes usually the cheapest is already grossly over what i would ever need,
there are some conditions through, e.g. i commonly have to repair automotive instuments, which have many odd senarios even including reverse biasing standard electros 7V for a clock signal, using 40V diodes on coil based tacho signals, that break down as a cheap zener to protect the other components on the peaks, to a cap on the end of a dropping resistor fed straight off ignition
in those cases its a best fit world. where i can for the clock signal instance i would replace with a non polarised or high capacity ceramic when i have the option (some designs require the high esr to work),
for the diode case i would replace it with a proper zener of atleast 2x the wattage but as its protection i would lower the voltage by 5V, (yes that is also related to this subject i believe)
and for a dropping resistor cap being how the actual thing pulling load off of it is not garenteed, i would generally triple the voltage rating if feasable, as the electrics on a car are truely horrendous, and a 18V rated cap on what should be 10V with all the spikes and crap will not last even if it was 25V rated, (in this case it was being fed off of 26V truck ignition)