Other than the obvious similarity that they are both written by the same author, O. Henry's two short stories do have differences as well as elements that are alike.
Ironic reversal: Both stories' endings are O. Henry's signature ironic reversal: Della and Jim in "Gift of the Magi" have sacrificed their prized possessions out of love for the other so that they could purchase a gift for each other's prized possession; Jimmy from "After Twenty Years" keeps the appointment made with his friend, but he pretends that he is not himself so that he does not have to shame Bob by arresting him. Instead, he has a plainclothes policeman make the arrest.
Theme of the intrinsic goodness in people: In his stories O. Henry proffers the romantic theme that there is an inherent goodness and dignity in people. Certainly, Della and Jim are unselfish and non-materialistic in their love for each other. And, Jimmy acts out of his respect for the old friendship and love he has for Bob by not embarrassing him by making the arrest immediately. Out of friendship, he also forgoes the glory and renown of being the officer to capture the notorious "Silky Bob."
As are most of O. Henry's stories, these two narratives are set in New York City at the turn of the twentieth century.
Denouements: The endings of the two stories are certainly different. While "The Gift of the Magi" finalizes the love of Della and Jim and the narrator praises their selflessness, calling them the Magi and, thus, glorifying their love, the ending of "After Twenty Years" is much more melancholic as Jimmy and Bob have lost their camaraderie and all the joy that they experienced in being friends when young.
Characterization: Della and Jim are very much alike in their natures; both are in love and are selfless in their giving, as well as being very non-materialistic. They both have sanguine personalities and do not let their disappointments that the other cannot use the Christmas gifts destroy their enjoyment of their Christmas Eve. For instance, Della tells Jim not to worry about the lovely combs for her hair because it will grow back. Besides, she has already told him, "...nobody could ever count my love for you." In similar fashion, Jim tells Della after he receives a watch chain for a watch he no longer possesses,
"...lets put our Christmas presents away and keep 'em a while. They're too nice to use just at present."
Unlike Della and Jim, "Silky Bob" is obviously materialistic as he sports a large diamond scarf pin and a watch whose lid is set with diamonds. He is also a criminal.
Jimmy and Bob have both done well financially--although Jimmy is not rich and Bob's wealth has been attain illegally--but Della and Jim are rather impoverished.