Thanks to advances in technology, neuroscientists can observe brain activity and understand how it is influenced by the quantity and quality of sleep one gets. Not getting enough sleep can make an impact on your sense of judgment, mood, energy levels, and even memory.

"People who are persistently sleep deprived are more likely to have high blood pressure, diabetes, and narrowed blood vessels," writes Dr. Howard LeWine, a practicing internist at Brigham and Women's Hospital, Boston. "Each of these can decrease blood flow inside the brain. Brain cells need a lot of oxygen and sugar, so blood flow problems could affect their ability to work properly."

The process of learning is usually described in three steps: Acquisition, which is when we are introduced to new information; consolidation, which is when our brain absorbs the information and recall, which is when we access the information after it has been stored successfully.

Sleep is necessary for the second step i.e. the consolidation of memories. The process helps strengthen or solidify memories in the brain so they can be recalled when you are awake. This has been demonstrated in experiments involving animals as well as human beings

While the exact mechanism is yet to be established, research has shown that two regions of the brain — the hippocampus and the neocortex — serve important functions by replaying, reviewing and processing the memories you have acquired. During this activity, the brain chooses to preserve significant memories and filter out negligible ones.

It is also believed that various stages of sleep play different roles in consolidating different types of memories. Both rapid-eye-movement (REM) or slow-wave sleep (SWS) have been linked to the consolidation of declarative memory. Motor learning, on the other hand, has been linked to the amount of lighter stages of sleep.

The duration of total sleep or specific stages of sleep is often highlighted in studies, explaining why it's a bad idea to pull an all-nighter before a big test. While staying up can help you activate short-term memory, it does not help in retaining the information.

"When we try to learn information quickly, we're only enabling short-term memory," explained David Earnest, Ph.D., a professor at the Texas A&M College of Medicine.

"This memory type extinguishes rapidly. If you don't 're-use' information, it disappears within a period of a few minutes to a few hours. Cramming doesn't allow information to assimilate from short-term to long-term memory, which is important for performing well on a project or exam."

According to guidelines set by the National Sleep Foundation, most adults can benefit from getting 7 to 9 hours of sleep while those who are past the age of 65 can ideally aim for 7 to 8 hours.