TFS can be very confusing when it comes to sprint ends.
I have found that the best way to make it work is to ensure that you have several sprints configured, with the end date of one being followed the day after by the start date of the next.
Want to learn Azure from scratch! Have a look at this video on Azure provided by Intellipaat:
If there is a gap between the sprint dates then the previous sprint stays 'current' up until the day on which the next sprint starts.
So something like this:
Sprint 1: 8th June - 21st June
Sprint 2: 22nd June - 5th July
Sprint 3: 6th July - 19th July
Note that there is no manual way to close a sprint. You have to do it with the dates.