It appears your battery is faulty.
If you have an iPhone 5, check the iPhone 5 Battery Replacement Program to get a free replacement.
If you have an iPhone 6s, check the iPhone 6s Program for Unexpected Shutdown issues to get a free replacement.
If your phone is under warranty or AppleCare extended warranty, you may be eligible for a free battery replacement. Even if it is not under warranty, go to the Apple Support webpage, "Start a service request" and fill in your problem details so Apple can help you.
If you have a Mac, you can find information about your battery by plugging into your computer and installing the free CoconutBattery app to check its health.