means that
even prolonged hardship or tedious work eventually comes to an end.
Imagine a case where if you have a difficult long day, it will inevitably come to an end; so all tedious tasks or difficult situations also have an end.; then “Even the longest day has an end” fits well.