"In the end" is used before a comma (,)
Example: he told his father he would not go to school, "in the end", he did not go to school.
And "At the end" in sentences where the word that follows is: of
Example: He went to school "at the end" of practice.