All the batteries including Li-ion battery have a maximum number of charging and discharging cycle times. When you charge with your cell phone on. It keeps draining charges out of the battery. The charger will detect the phone not in max capacity and hence charge again. This will shorten the battery's life in result.
There is a sticky here.
http://cellphoneforums.net/general-cell-phone-forum/t280477-prolonging-your-cellphones-battery-life.html