You cannot determine the voltage of a capacitor by looking at it.
The only way to decide on the voltage-rating is to look at the circuit diagram and see what voltage is on or around the capacitor.
Generally you have 3 different voltages:
For 5-12v circuits - use 50v ceramic caps and 16 - 25v electrolytics
For circuits near the mains (110v to 240v) use caps 250v to 400v
For high voltage circuits such as 1kV to 5kv, use 1kv caps or 5kv caps.
The capacitor value has to be just above the maximum expected voltage - taking into account spikes and peaks.
There are other special things to take into account -such as ripple factor - temp, impedance of the capacitor and these will alter the size and shape of the capacitor - over and above the voltage rating.
When you get into switching power supplies, the type of capacitor (electrolytic) can be absolutely critical -so it's very difficult to give a simple answer.