A Sprint ends when the timebox expires, not when the work is finished.
Unfinished Sprint Backlog Items are returned to the Product Backlog and can be addressed by the Product Owner by re-ordering the Product Backlog allowing the item to be worked on in a future Sprint.
This is a more effective way of working than extending the Sprint because ensuring a consistent Sprint length:
- Decreases variability.
- Improves the team’s ability to determine how much work they can complete within a single Sprint.
- Improves their estimations of whether certain types of work can achieve the Definition of Done within the Sprint.
The Product Backlog should give transparency over the work that is believed to remain for the Product. The Developers should re-estimate any unfinished work there accordingly. The Product Owner may — or may not — then order it as a priority matter for consideration in the next Sprint Planning event.