Turns off? Like completely shuts down? You sure the iPhone isn't just locked and you have to do the whole "slide to unlock" thing?
Or do you mean it turns off and you have to hold down the button to get it to boot back up, and you wait for the Apple logo to appear, etc.?
If it really does fully shutdown (Apple logo at boot and all) then you should contact Apple support.
If it just locks (slide to unlock screen) then you just need to change your auto-lock settings on your iPhone so it doesn't auto-lock after a period of time.