Created by Shigeru Miyamoto while he was developing Donkey Kong (which, incidentally, was supposed to be a game based on Popeye), Mario was first known as "Mr. Video" before ever appearing in a game. Miyamoto has gone on to say he's glad the name was changed considering Nintendo's goal at the time was to create a character as popular as Pac-Man.
Donkey Kong shipped as an arcade in July 1981 with the main character being an unnamed carpenter in the Japanese version and "Jumpman" in the English instructions.
As company lore goes, when Nintendo was localizing the game for US audiences, then-president Minoru Arakawa got into a heated argument over property rent with Mario Segale, landlord of the company's American headquarters and the inspiration for Mario's name, which first appeared in a Donkey Kong sales brochure that same year.
According to a statement by Miyamoto at the Super Mario Bros. 30th Anniversary festival in September 2015, Mario's last name is also Mario (Mario Mario).