Macbook Air 2011 only wakes from sleep if plugged in
It's hard to know if this is a hardware failure or a software issue, but the first step is opening terminal and running some power management tools to see what is really happening.

 pmset -g log


The above command will dump a very long log you can save to a file by copying it or redirecting the output like pmset -g log &gt;&gt; ~/Desktop/sleep.log and looking over the times when it slept and woke properly. Perhaps it's going to have a hint what is happening when the wakes do not work.

Secondly, you could run pmset -g pslog in a second window and let it run. When you sleep and wake, it should log those power events in real time. The next time it needs a power adapter to wake you can review the events that led up to that failure. It also lets you see what's happening when you test sleep and wake.