When Shigeru Miyamoto created Mario for the 1981 Donkey Kong Arcade Game, he was just called "Jumpman." Jumpman was the hero of the game, and his mission was to rescue a damsel in distress from a giant ape named Donkey Kong. The character was later renamed "Mario" in the 1982 arcade game Donkey Kong Junior, the only game in which he has ever been portrayed as an antagonist.
Mario's profession was chosen to fit with the game design. Since Donkey Kong was set on a construction site, Mario (then Jumpman) was made into a carpenter. When he appeared again in Mario Bros., it was decided he should be a plumber, since a lot of the game is played in underground settings. Mario's character design, particularly his large nose, draws on western influences; once he became a plumber, Miyamoto decided to "put him in New York" and make him Italian, lightheartedly attributing Mario's nationality to his mustache.
His surname is "Mario", resulting in Mario's full name being "Mario Mario".