BlackBerry has this feature and perhaps there is some third party app on an iPhone that can do?
The iPhone is only sleeping when it is "off". The phone falls asleep at an interval you decide under Settings/General/Auto-Lock. Your options there are 1, 2, 3, 4, or 5 minutes or "never". It turns on (or wakes) whenever you get a call, a text message, an alert, etc.
There is no automatic way to turn it off or on.