A capacitor charges to 63% of the supply voltage that is charging it after one time period. After 5 time periods, a capacitor charges up to over 99% of its supply voltage. Therefore, it is safe to say that the time it takes for a capacitor to charge up to the supply voltage is 5 time constants.
Time for a Capacitor to Charge = 5RC
simulate this circuit – Schematic created using CircuitLab
Charging a Capacitor One time constant,
$$\tau=RC=(3\text{k}\Omega)(1000\mu\text{F})=3\text{ seconds, }5 \times 3=15\text{ seconds}$$
So it takes the capacitor 15 seconds to charge up to near 9 volts.
I don't understand: what if I don't attach a resistance in between? What will be the time to charge the capacitor?