If it's a new purchase (if the person who gave it to you bought it new) have it replaced.
It if's not new, I'm guessing that the charger port is bad - and it may be cheaper to buy a good used one than to have that one repaired. (It won't turn on because, since it can't be charged, the battery died,)