Sprint planning
The team selects the items that have the highest priority and that are ready for work to start. The team can only commit to stories that have clear objectives, and that are not blocked by anything else. Also, the team can commit only to a limited number of stories during a sprint. That means that the team needs to know how much work will be involved with these stories, and how much work can be done during a sprint.
To determine how much work can go into a sprint, we need to know the team's velocity, which is a number that expresses the total effort a team is capable of in a sprint. That number comes from evaluating and determining the average amount of work done (sum of story points) in previous sprints. Of course, seasonal influences (holidays) and other things that could determine the team's capacity need to be taken into account. No extra work should be added to a sprint once the team has committed to start.