The allusion to the Magi of the Bible, extends to the idea that these men traveled from afar to be in the presence of the greatest gift of God to mankind, His only Son:
For God so loved the world that He gave his only begotten Son, that whosoever believeth in Him, shall not perish, but have everlasting life. [John 3:16]
Clearly, O. Henry's story is one with a very Christian theme, the theme of love as meaning that one is willing to sacrifice one's own desires for the happiness (or safety) of another. Like the Magi, Della and Jim understand the true meaning of love, and they understand that sacrifices are often necessary in order to experience true love. Like the Magi who traveled from great distances under strenuous conditions, Della sacrifices her prized possession of her luxurious hair in order to buy a present for Jim, and Jim does likewise for Della; in the end, they give each other the richest gift of love, just as the Magi bring the baby Jesus rich gifts.