The primary function of sleep is to permanently store the things learned during the day (long-term potentiation). Although different people need different amounts of sleep, those who need less usually find that they sleep longer if they learn challenging new material (e.g. a new language). That is the reason why babies sleep the most. Their brains are empty sponges constantly absorbing new information.