The ESP8266 module has quite a list of features, and thus also consumes a fair amount of energy, especially when using the wireless capabilities. The D1 Mini comes equipped with four different sleep modes to counteract this: no sleep, modem sleep, light sleep and deep sleep.
No Sleep
When the ESP8266 is set to no sleep, all the systems are kept online at all times. This is obviously the most inefficient setting and will drain the most current.
Modem Sleep
When modem sleep is turned on, the WiFi module will close the circuit in between the DTIM beacon intervals. This mode can only be used when the ESP8266 is connected to an access point. The ESP8266 will automatically turn the module back on. The microcontroller will stay connected to the network and the webserver will also stay available.
Light Sleep
Light sleep is similar to modem sleep, but also suspends the CPU from performing computations. The ESP8266 can be woken up again by getting some input from the GPIO pins.
Deep Sleep
Deep sleep is the best option if you want to save as much energy as possible, as it turns off all systems, except for the Real Time Clock (RTC). This mode can only be entered by an explicit statement. The ESP8266 can then only be woken up from this sleep if the RST pin is set to LOW. This means the whole system will reset. This can be done in two ways:
Connect the RST pin to GPIO16 (which coincides with the wake pin). We can then specify a time for the ESP8266 to go into deep sleep. After this time the wake pin will send a LOW signal and wake the ESP8266. Below is an example of such a system.
The second way is to go into an indefinite sleep and wake the ESP8266 from an outside source. To do this from an outside source (a push button, or switch), you can connect that to the RST pin and when it receives a LOW signal it will wake up.