We need to be able to demonstrate to the UKVI at audit that you have always complied with the terms of your visa expiry. If your visa expires during the course of your programme we need to either have proof of making an in time application or proof that you are no longer in the UK in order to keep you as an enrolled student.
If you have to come to the end of your studies, you will have been asked for an exit stamp to show that you left at the end of your studies or switched to another immigration category.