I have been through 3 phones that all did this. I have come to the conclusion that it's a software glitch rather than a hardware one.
What I ended up doing was restoring the phone as new, which means you will loose all of your saved data. You can still redownload all of your apps. but your saved data will be gone. If you don't want to do this then try turning off wifi while charging. That also worked good for me.
Now I will admit that about once or twice a month I will still get the 95% charge, but most of the time it charges 100% now and that is with wifi on. With wifi off it always charges full.