Yes the PS3 will only charge the controllers when it is on. You can charge the controller while playing a game with the charging cable.
additional information
The PS3 Dual Shock 3 controllers charge will diminish if they are let on and it is advisable to go to the PS3 settings menu for controllers and set it to automatically turn off the controllers when the PS3 is turned off. The controllers do not have to be on to charge and it let on they will need to be connected to the charging cable before they can be used.
The USB cable does not have to be plugged into the PS3 to charge the controller, any USB input will work. I have a live USB input on my HDTV and connect the controllers to it.
Chat with our AI personalities
leave the PS3 turned on and change the settings to turn off the controller when the PS3 is turned off. You can turn the controller and the PS3 back on by pressing the PS3 emblem on the controller
You use the charging cable to connect the PS3 to Controller and press the Playstation Emblem on the controller
When the PS3 is on use the charging cable to connect the controller to the PS3 and press the Playstation Emblem on the controller
It does not take long for it to get enough of a charge for the red lights to work. Plus when the item is plugged in it has power and will work as a controller while it is charging.
couple hours, but you can use it while charging with the cable attached during that 2 hours.