Set Time Until PS4 Turns Off

To set the amount of time your PS4™ system can remain idle before it either enters rest mode or turns off, select (Settings) > [Power Save Settings] > [Set Time Until PS4 Turns Off].
You can set the time separately for [Media Playback] and [General (Applications)].