The phrase indicates a willingness to do more than what's expected, often to help someone. He went out of his way to help her move into her new apartment.
Pro Tip 2/3
Personal Sacrifice
Using this phrase suggests that someone may be inconvenienced for the benefit of others. I went out of my way to pick up the cake, missing my favorite show.
Pro Tip 3/3
Appreciative Tone
When someone goes out of their way, acknowledging this act shows gratitude. Thank you for going out of your way to bring me lunch.