Your circuit isn't great. You need gate drive resistors, and mostly, the 555 is not the right chip if you want a latch, and it's painful when you need many.
So, instead, you could, if you have basic logic gates lying around, use a buffer¹ with its output fed back through a large resistor to its input, and the same input is connected to your microcontroller pin.
This assumes your microcontroller lets its outputs float when off. Pay attention to not accidentally back-feed the microcontroller this way!
You can, however, just buy Latches or Flipflops, depending on whether you want to have a clock input at which the output changes (ff) or not (latch).
For 0.40€ apiece for an octal latch, your 555 solution is way more complex and expensive - not only do you need the 555, you also need two MCU outputs per output; with an octal D-latch, you can work with 1 MCU GPIO per output, and one "latch enable" for all outputs combined. Other options involve a serial-in, parallel-out shift register (which means you can have as many outputs you want with 3 GPIOs), or, honestly:
Don't use an external latch at all. Your microcontroller has that integrated.
Simply never shut off your microcontroller, as if you're switching any significant load, then the current consumption of an idling or sleeping (fix your sleep mode, your MCU can do that, "I haven't found the way to use it properly" is not a good excuse!) MCU will not matter at all. E.g. your LED uses 50 mA. Your ESP32 in "light sleep mode" preserves its output states and uses 0.8 mA (datasheet, Table 6 on page 31), so 1.6% of the overall power. Forget about using external latching! You'll never notice the difference in battery lifetime!
You can even go to ESP32's deep sleep mode (espressif idf's gpio_hold_en(YOUR_GPIO); gpio_deep_sleep_hold_en();
allows you to do retain state, according to documentation), and then you're down in the microampere range – i.e. you could operate from a coin cell for years. So, seriously, you need none of this, but to figure out your software!
Overall recommendation
- Add the ability to go into deep sleep mode to your firmware. The ESP framework by espressif does make that possible, and it allows the outputs to hold state while the microcontroller consumes < 100 µA.
- Use logic-level MOSFETs. Your choice of MOSFET isn't great, you need something that fully turns on at 3.3 V.
- Connect the gate of your MOSFET directly to your ESP32, through a gate resistor (quite possibly in the kΩ range)
- Add a linear regulator to 3.3V (and Schottky diodes to avoid backfeeding, to both your battery and the regulators output) from your LED power source. So, as long as your LEDs have power, you don't need to worry about the MCU not having power to remain in a light or deep sleep mode.
- Since you say this is battery-powered, review your overall power system design. Chances are you really only need one power source – for your LEDs, since they are the dominant consumer of power. If you've got a battery that powers these, chances are you have a switch-mode power supply already; make sure you're not doing something "interesting" like stepping up voltages (e.g. to 5V) to then linearly waste a lot of power again – the ESP32 needs no more than 3.3 V of VCC; every voltage above that just gets converted to heat internally.
Maybe you can even just completely shut down everything while that power source is not available – after all, nothing to light up without! In that case, store the output state you have in nonvolatile memory (the ESP32 comes with some) and restore on power-on; the user will never even know the ESP32 reset in between!
¹ alternatively: an AND where you tied one input to VCC, or an OR or XNOR where you tied one input to GND