The Sleep setting adjusts how long it takes for your Android device's screen to turn off automatically, after you stop using your device.
Effect on battery life
Your device's screen consumes a lot of battery power, with the "screen on time", the amount of time the device's screen has been turned on since the battery was last fully charged, often being the biggest contributing factor towards battery life, along with screen brightness. You can see your screen on time in the Battery settings.
To minimize your screen on time, it's good to turn off the screen while you're not using the device. The Sleep setting controls how long it takes for the screen to turn off automatically if you haven't interacted with the device for a while.
Some apps can override the auto sleep mechanism. For example, apps for viewing videos will usually force the screen to remain on while the video plays regardless of this setting, so as not to interrupt the video viewing experience.
In addition to being able to set the sleep time in minutes, some devices have various "automatic" settings for this feature.
Some devices have a feature that detect, through the front camera of the device, whether you are still looking at the screen. If your device thinks your eyes are still looking at the screen, it will keep the screen on. This feature uses some additional battery by using the front camera.
Some devices may have an "auto sleep" feature whereby the amount of time it takes to turn the screen off depends on whether the device is sitting horizontally, such as on a table, or if it is held at an angle, as if it's being held in the hand. This tends to use less battery power but be less effective.