Chosen Solution
iphone automatically turns off without pressing the power lock button
Sometimes this can be due to faulty battery. Try another battery as the first trouble shooting step.
Brad has given the best answer, assuming you refer to a hard shutdown with the wheel in the center of the screen, and the apple logo at start up. Otherwise, Settings>General>Auto-Lock, gives options for 1min, 2min, 3min, 4min, 5min, and Never, as intervals of inactivity after which the phone goes to “Lock” the same as if you pressed the power lock button quickly without waiting for the red “Slide to power off” slider to appear.