This is the 3319th most frequent Korean word.
끝나면
"끝나면" means "if/when it ends" in English.
"끝나면" here connects the ending of a class with the subsequent action.
수업이 끝나면 도서관에 가요.
When the class ends, I go to the library.
"끝나면" indicates the transition from the completion of the movie to the next activity.
영화가 끝나면 식사하러 갑시다.
When the movie finishes, let's go for a meal.
"끝나면" is used to relate the finishing of work with the expressed desire.