For a long time, sleep was regarded as a passive state, a pause in the brain's activity during which nothing of importance happened. That view began to change in the 1950s, when researchers recording the electrical activity of sleeping volunteers noticed recurring periods of rapid eye movement, during which the brain was almost as active as when awake.
Since then, a large body of evidence has linked sleep to memory. In a typical experiment, volunteers learn a list of word pairs in the evening and are tested the next morning; those who slept between learning and testing generally recall more than those who stayed awake for the same length of time. The effect appears to depend less on the total amount of sleep than on particular stages of it.
None of this means that learning can be done in one's sleep. Attempts to teach people new material by playing recordings during the night have repeatedly failed. Sleep seems to strengthen what was learned while awake, not to replace the effort of learning it.