Self-insert
A self-insert is a character created by an author as a way of putting themselves into the story. A self-insert who is too prominent in the story, or too perfect, is said to be a Mary Sue.
Wesley Crusher served as the self-insert for Gene Roddenbery.
Kathryn Janeway was the self-insert for Jeri Taylor when she wrote scripts for Voyager.
Luke Skywalker (Luke S.) was the self-insert for George Lucas in the original Star Wars.