Your cable may not be working properly, in which case, you should check to see if it has any physical damage. You may have to buy a new cable.
However, this could also be a battery issue. You may have to replace the battery. iFixit has a device guide that will instruct you on how to do so.
Another issue could be that your controller isn't charging properly. As I mentioned earlier, this could be an issue with the cable. However, it could also be an issue with the charging port. iFixit also has a device guide that will instruct you on how to replace your controller's charging port.