"If I want to charge a battery with a 2 watt capacity, how long is it going to take me if I'm using a power source with a continuous output of 2 watts?"
There is no way to tell. The maximum instantaneous power output (2 W in your case) doesn't tell us how much total energy the battery can hold. For example, if this battery can only sustain this 2 W output for 15 minutes before it goes dead, then it can hold 1/2 Watt-hours, which is 1.8 kJ. If it can sustain 2 W output for 10 hours, then it can hold 20 Watt-hours, or 72 kJ.
You are charging the battery at 2 W, which is the same as saying you are transferring 2 J of energy into the battery every second. Obviously it will take a lot longer to transfer 72 kJ of energy at 2 J/s than it will take to transfer 1.8 kJ at 2 J/s.
On top of that, batteries have inefficiencies. If this battery is 75% efficient, for example, then you need to give it 1/75% = 1.33 times more energy during charging than it can ultimately hold and return to you during discharging.