It is inevitable to experience some kind of frustration after you have experienced your first couple of lucid dreams only to wake up shortly after becoming lucid. Fortunately there are ways to make your lucid dreams last longer and enhance the level of vividness while you maintain a sense of being grounded and control.
I remember my first four lucid dreams lasted only a few seconds, either because I woke up from the excitement that I was lucid dreaming or because I simply wasn't grounded nor lucid enough to fully engage in my lucid dream, thus rapidly losing awareness by being caught up in the dream and losing control.
Yet before even attempting a technique within the dream to prolong your lucid dream you should first be absolutely clear on what you desire to accomplish on your next lucid dream. Having a clear intent will increase your chances of arriving in a dream scenery that will match what you desire to accomplish. This clear mindset and the matching scenery will serve three purposes:
1) That you remember your intent and what you desire to accomplish. Often when we become lucid we will startle ourselves asking "What was I suppose to do?"
2) Avoid having to waste any time and effort trying to change your dream scenery. Your scenery will likely be in alignment with your intent.
3) Avoid inactivity due to being in a state of wonder leaving you with your mouth opening and saying "wooooooooowwwww". This period of inactivity could result in the dream fading away or suddenly losing consciousness and fully engaging in the dream drama.
It is extremely important to be aware that there are different levels of lucidity and you should aim to achieve the maximum level of lucidity in order to prolong the duration of your lucid dreams.
The most important step to both enhance your level of lucidity and make your lucid dream last longer is to fully ground yourself and get "locked" in the dream when you gain lucidity. The key is to engage with the dream with as many of your senses as possible, especially the tactile and visual senses.
For those who have never experienced a lucid dream, when recalling the nature of dreams they will often describe it as "fuzzy" or "unclear". Yet those who have experienced a high level of lucidity will attest that the dream world can appear as real as ordinary reality. When you become lucid, before attempting to do anything else, you should touch the ground or a wall to feel its texture. You can also touch your dream body or rub your hands. Next focus your vision upon one object within your dream until it becomes crystal clear. This sensory "overload" will help you become fully engaged with your dream and less aware of the sensory input coming from your physical body that might wake you up.
Once your senses are anchored in the dream you will notice how the dream becomes progressively more vivid: the colors, sounds, textures and entire scenery becomes alive! Now you are ready to explore the dream world, accomplish your predetermined intention and control your dream at will. Your focus is key, active focus that is. One must constantly have a single minded focus on the task or goal at hand. Often novice lucid dreamers will accomplish a desire, action or goal when lucid and after this has been fulfilled they will lose focus for a "second" and the unconscious mind will take over.
Other behavioral techniques that can be used to prolong your lucid dreams are spinning around, stamping your feet or jumping up and down. Be aware that when you spin your body around this will often lead to a sudden dream scenery shift. Narrating out loud everything you are doing or wish to do within the lucid dream will also help you maintain your lucidity while keeping you focused on what you want to accomplish.
Dreaming mostly occurs when we are in REM (rapid eye movement) sleep. Although in the first half of the night you do experience REM, the first 4-5 hours of sleep are dominated by nREM (non rapid eye movement) sleep or deep sleep. When we are able to suppress REM, like when we drink alcohol, we will experience an REM rebound where our mind will compensate for the lost REM. Obviously consuming alcohol to suppress REM is not advisable for achieving lucidity nor for health reasons.
Supplements like Melatonin and 5-HTP, when taken before going to sleep, will suppress REM sleep in the first half of the night thus allow the REM rebound effect to take place. More REM means more dream time.
Another trivial factor when it comes to having longer lucid dreams is the type of lucid dreaming induction technique used to achieve lucidity. When using the MILD or DILD techniques we are at the mercy of becoming lucid by recognizing dream signs and performing reality checks. This could happen in the beginning, middle or at the end of a REM cycle. Many lucid dreamers will become lucid when the dream is about to end and only give them a few seconds or minutes of lucidity.
That is why mastering the WILD technique or supplement induction technique can reap superb benefits when it comes to having long lasting lucid dreams. Both of these techniques will allow you to transition from wakefulness all the way to the beginning of the dream with full consciousness, increasing your chances ten fold of experiencing lucidity for the entire REM cycle until the dream fades.
However, when the dream begins to fade and you find yourself in the midst of blackness, don't worry and simply remain conscious as the dream scenery will often return and you will find yourself slipping into another lucid dream. And lastly, keep calm. Getting overly excited when you are lucid will often result in waking up. So whatever you do, enjoy the magic as it happens yet keep yourself cool, calm and collected.