Try this Simple things to know where the fault lies?
Try another Samsung Galaxy S4 phone's battery, borrow from your friend or someone known, if it charges in time and stays, then it is clear that it was a problem with the battery, check your battery with his phone also.
If trying another...