When should a Sprint be considered as completed?

I have a question relating to the open assessment: When should a Sprint be considered as completed or over? Given two options: 1. When the sprint time box expires 2. When all the tasks in the sprint are completed Which one is the correct answer? Ideally, it should be when the time box expires. But what if stories get completed before the sprint time box expires? Can the sprint be terminated then?

Posted By - SW