A quickie on how sleep and long term memory works:
The pineal gland (aka the "third eye") is about the size of a grain of rice/a pea located at the base and in between both hemispheres of the brain. When it gets darker out the decrease in lighting sends signals to your eyes which sends messages to your pineal gland (why it's called the "third eye"). In the pineal gland, there are cells called pinealocytes that produces and secretes melatonin (a hormone that causes drowsiness and your body temperatures to drop). The melatonin in your body helps regulate your circadian rhythm aka your body's 24 hour clock. When your body's clock is out of whack a lot of things are too like your metabolism, hormonal rhythms, and neurostransmitter rhythms (chemical that carries messages between cells).
Ever heard of people telling you to not do all nighters to cram for an exam? Well it's true, cause your brain needs sleep in order to retain the information you're feeding it. And if you're pulling an all nighter...well it's all a cycle, put it together!
Everything above is summarized by me and I hope it's correct. If it's not feel free to correct me. Cause I won't learn from it if I keep thinking what I've been reading is right. (=
source for picture