Answer by taking a quote from the following article:

Luke Skywalker is a fictional character and the main protagonist of the original film trilogy of the Star Wars franchise created by George Lucas. The character, portrayed by Mark Hamill, is an important figure in the Rebel Alliance's struggle against the Galactic Empire. He is the twin brother of Rebellion leader Princess Leia Organa of Alderaan, a friend and brother-in-law of smuggler Han Solo, an apprentice to Jedi Masters Obi-Wan "Ben" Kenobi and Yoda, the son of fallen Jedi Anakin Skywalker (Darth Vader) and Queen of Naboo/Republic Senator Padme Amidala and maternal uncle of Kylo Ren/Ben Solo. The now non-canon Star Wars expanded universe depicts him as a powerful Jedi Master, husband of Mara Jade, the father of Ben Skywalker and maternal uncle of Jaina, Jacen and Anakin Solo.

Luke Skywalker was initially called "Luke Starkiller", and went through multiple design changes. The character was at one point designed as a 60-year-old grizzled war hero, later as a Jedi Master, and as a woman. The last name "Starkiller" remained for the first few months of production, Hamill on-camera used the name 'Luke Starkiller" the sole time he referred to himself during filming. "Starkiller" was dropped due to what Lucas called "unpleasant connotations".  An alternative ending pitched by George Lucas for Return of the Jedi was Luke assuming his father's role as Darth Vader after the latter's death and intending to rule in his place. Though Lawrence Kasdan favored the idea, Lucas ultimately declined, since the films were made for children. Another conclusion to the film featured the character disappearing into the wilderness akin to "Clint Eastwood in the spaghetti westerns".  During the filming of the original Star Wars trilogy, George Lucas informed Hamill that he would be needed to reprise the role when he was middle aged. Lucas further explained that his role as Luke would be handing "Excalibur to the next generation". Hamill had no reaction at the time, as he thought of making Star Wars films decades in the future as an abstract concept. Hamill learned of the sequel trilogy over the summer of 2012 at a Star Wars celebration during lunch where Lucas told him one was in development. Hamill recalled shaving his beard to portray The Trickster in The Flash, then letting it grow back for the filming of his scenes.  Luke's lack of screen time in The Force Awakens was due to concerns by screenwriter Michael Arndt that his presence would mean the audience would have less interest in protagonist Rey, leading to an agreement that he be removed from the plot and instead become a plot device. Hamill attended meetings for script readings, and helped conceal Luke's role in the film; instead of dialogue, he read stage directions. Abrams said it allowed him to remain involved and that his reading helped make a "better experience for everyone."

How was Luke Skywalker created?
went through multiple design changes.