Why do we wake up from sleep (from a dream) as soon as we figure out reality? In a dream why do we wake up when we figure out that its not real. I mean even in a lucid dream we are lost to some extent and as soon as we stop accepting the situation we tend to awaken?
When you are dreaming, and you realize that it is a dream, the initial surprise can wake you up. However, you can build a skill for staying in the dream by anchoring yourself to simple actions in the dream. For example, as soon as you realize that you are dreaming, look at your hands and start shaking them in the dream. Generally, you will start to wake up, but then will feel yourself moving back into the dream. Once in this state of being fully aware of the dream and fully in the dream, you can start taking control of the dream.

There are several other techniques to help spot your dreams and help you remain in them to facilitate lucid dreaming. Here is a pretty decent article.