well with the engines off electrical supply is coming only from the battery and it will run out. But your engines should not be off in the air. You turn your generators on by finding the generator switch and turning it on after you turned on the engines. I might be able to tell you where they are if you tell me what airplane you fly the most or which airplane is giving you the problem. On the ground when parked unless you need the battery on turn it off so you can save power.
"It was just four of us on the flight deck, trying to do our job" (Captain Al Haynes)