There could be several things that could cause this issue.
Do you see any indication that the phone recognizes that it is plugged into a charger? Does the charge led come on when plugged into a charger? Does the screen display any type of a battery symbol when plugged into a charger? Does a PC recognize the phone when plugged in? If the answer is no to all these questions then you likely have a faulty USB charge port on the phone and may need to replace it or possibly just clean it.
If the phone does show a battery logo on the screen with an exclamation point inside it then this means the battery is not communicating properly with the device. This can be caused from a poor connection to the motherboard or battery or from a faulty battery. Check the battery's connection to the motherboard and make sure there is no damage to the cable such as a tear. Try reseating the connection to the motherboard if the cable appears undamaged.
Has the phone been exposed to water or any liquid? If so the battery was likely damaged and would need replaced. You will also need to properly clean the phone which if this is the case reply back and mention it has water damage and myself or someone else can explain how to properly clean the phone.
Do you often let the battery discharge to the point it shuts the phone off due to a low battery? If the answer is yes then trying what aebelcarris mentions in his post may help solve the issue. Li-ion batteries do not like to be discharged or overcharged. Doing so will likely decrease the battery's lifetime and can also cause issues like this. There is a built in circuit that helps protect the battery from overcharging, discharging, and more. If the protection mode is activated it puts the battery in a sleep like state. At this point it will not respond to a normal charger and will require a boost charge which supplies the battery with a higher voltage for a short period of time. This helps wake the battery. Once it wakes then it can then be charged with the original charger.
There could be more possible reasons the battery won't charge but I just listed the more common issues I have experienced with the HTC one.