I leave my window ac on when I'm not home.
I set the temp I want and the compressor comes on when needed and shuts off when it's not needed.
When you shut your ac off and then turn it back on when you get home the window air conditioner has to work harder to cool off the room or house.