Apple iPhone 5 doesn't charge attached to a laptop
This can have 2 reasons
1. You're using an aftermarket cable with too much electrical loss.
2. Your laptop USB port(s) don't deliver enough power.

Both situations sometimes are paired with the iPhone making non stop charge-beeps like you connect and disconnect the charging cable - but I read that this is not the case with you.

I found out that this situation comes up less frequently, once the iPhone battery is above 70 or so percent.