This man is believed to have been a chivalrous knight (likely of British or German descent) during the medieval era. At some point in time he was executed via beheading by an executioner and subsequently became a ghost. The knight would come to befriend the ghost of his executioner and the two came to reside in the Haunted Mansion.
The Haunted Mansion
The knight appears towards the end of the graveyard scene, singing Grim Grinning Ghosts alongside the executioner and Gus the prisoner (who may have some affiliation with them). They also appear nearby a pair of opera-singing phantoms with the knight's proximity to them being a gag on the expression, "A (k)night at the opera".
In this film, the knight appeared in the graveyard scene nearby the executioner beheading an unidentified ghost. He waves at Jim Evers as their hearse goes by.
The Ghost Gallery
In the 1990s, cast-members of the Haunted Mansion in Walt Disney World created a backstory for the attraction as a means of answering guest questions. All of this backstory was recorded on paper and while unofficial, has since influenced both the original Haunted Mansion's official and semi-official features as-well as adaptations based on the Haunted Mansion.
In this created storyline, the executioner was named Giovanni Jones and was part of a family of opera-singers. In 1937, they put on a performance for the Gracey Family in the graveyard of Gracey Manor based on an original script called Don Juan in the Underworld. In this performance, Giovanni played a knight, his brother Rocco played an executioner, while his siblings Carmen and Antonio (the opera ghosts) played vikings.
During the performance in a mock execution scene, Master Gracey's deranged relative Gus Gracey (the prisoner) activated a trap-door beneath Rocco's feet. Due to this, Giovanni was inadvertently decapitated while Rocco was beaten to death by Gus with an iron ball & chain in the chamber below. The other siblings were murdered by Gus with a gas canister he used to create a fire.
In this video-game the executioner is explained to have been killed via guillotine rather than axeman (which is odd considering the guillotine wasn't invented until the 18th century). He is an ally to Ezekiel Holloway, the main character of the game.
The knight is an enemy in this video-game, while he is headless in concept-art he has his head intact in the game. He is summoned to attack the player by Madame Leota with the ghost of Phineas entering the suit of armour from the ride. The knight is defeated when the player drops a grandfather clock on him.
His appearance might be a play on the Beheading Game, a famous story affiliated with English Christmas practices which regards King Arthur's nephew Sir Gawain entering a game of life-and-death with a, "Green Knight" who aims to behead him.
In the book, "Build your own Haunted Mansion" he was given the name of Gawain. Gawain is a name also coming from Arthurian myth, being affiliated with Lancelot's son Sir Gawain who is affiliated with holiness and found the Holy Grail.