A mentor is a wise older person every hero regularly sees in good stories, such as Gandalf from the Lord of the Rings, Yoda from Star Trek, or Alfred from Batman.
The mentor represents a bond between parent and child, teacher and student, god and man. The mentor is there to help the hero to face the unknown future and to accept adventure.
In most hero's stories, the hero is busy in an everyday world when they get called to an adventure. Initially, they will be reluctant, either not feeling equipped for the task or too comfortable with life as it is.
The mentor will hand the hero supplies, knowledge, and the confidence required to face the adventure. When the story seems to direct to a dead-end, mentors are the ones who provide aid, advice, or magical equipment. Mentors show that we often learn life's lessons from someone else.