Dependant on the age of your iPhone 4S it could be the battery is failing. You could take it to an Apple store or AASP for evaluation.
Also worth trying a re-boot. Press and Hold the Home and On/Off buttons simultaneously until you see the Apple logo then release. You will not lose any data.