There are several settings that are involved in determining how quickly your iPad will go to sleep, and several "tricks" to know about to give you a bit more control over this behavior. Another tutorial explained how you can customize how soon your iPad auto locks, and the sleep setting of your device is related, since the Auto-Lock feature will automatically put your iPad to sleep; so, the higher the value you choose for how quickly the iPad locks, the higher it will be for sleep state (including choosing "Never", which means that your iPad will not lock at all after any period of time).
On the one hand, how quickly your iPad goes to sleep is designed to save power while running on battery, and be a more energy efficient device while plugged in or on battery. Manually, a single tap on the iPad screen when it dims will re-wake up the iPad as a preventive measure, and "reset" the counter until the next time the screen dims, and the amount of time that will elapse before the device tries to auto-lock or go to sleep once more.
On the other, some apps (like picture frame) require by definition that the iPad stays up and running and need to ensure that your iPad doesn't go to sleep at all. It ultimately depends on your iPad usage (at the time), and what sacrifices on energy consumption and battery life you are willing (or forced) to make. Keep in mind that since the screen of the iPad is the biggest consumer of electricity at all times, never letting your iPad go to sleep will considerably shorten your battery life, and, ultimately, the life of the battery itself, since it will find itself drained all the way down much more often!