In an software development project that leads by Agile scrum methodology, sprint backlog is a subset of the product backlog that contains user stories, tasks and other development related activities to be completed within the sprint. In the sprint plan meeting, development team discuss and select relevant tasks and user stories for the sprint backlog based on their priority, effort to be completed and capacity of the sprint. Though in product backlog consists of high-level user stories, sprint backlog contains smaller and more manageable tasks.
It comes to our Agile based project, we have selected the most prioritised tasks and user stories from our product backlog based on the value that we can deliver to the customer in the end of the sprint. While selecting the tasks we considered about the effort we have to spend on it to complete and capacity of our sprint also. Though there was a high priority tasks available to be completed, we have to postponed it cause capacity of our sprint was not enough.
I think we can list down the tasks based on the priority order (most prioritised task on the top) in the product backlog and take the top few tasks which fits to our next sprint size. I think if we select a task which takes more time than our sprint can cater and try to complete with extra time allocation, it will reduce the quality of the feature and it will break the work life balance of the developers also. Then we have to be careful while selecting the tasks for sprints.