Mr. James Dillingham Young ("Jim") and his wife, Della, are a couple living in a modest apartment. They have only two possessions between them in which they take pride: Della's beautiful long, flowing hair, almost touching to her knees, and Jim's shiny gold watch, which had belonged to his father and grandfather.
On Christmas Eve, with only $1.87 in hand, and desperate to find a gift for Jim, Della sells her hair for $20 to a nearby hairdresser named Madame Sofronie, and eventually finds a platinum pocket watch fob chain for Jim's watch for $21. Satisfied with the perfect gift for Jim, Della runs home and begins to prepare pork chops for dinner.
At 7 o'clock, Della sits at a table near the door, waiting for Jim to come home. Unusually late, Jim walks in and immediately stops short at the sight of Della, who had previously prayed that she was still pretty to Jim. Della then admits to Jim that she sold her hair to buy him his present. Jim gives Della her present – an assortment of expensive hair accessories (referred to as “The Combs”), useless now that her hair is short. Della then shows Jim the chain she bought for him, to which Jim says he sold his watch to get the money to buy her combs. Although Jim and Della are now left with gifts that neither one can use, they realize how far they are willing to go to show their love for each other, and how priceless their love really is.
The story ends with the narrator comparing the pair's mutually sacrificial gifts of love with those of the Biblical Magi:
The magi, as you know, were wise men – wonderfully wise men – who brought gifts to the new-born King of the Jews. They invented the art of giving Christmas presents. Being wise, their gifts were no doubt wise ones, possibly bearing the privilege of exchange in case of duplication. And here I have lamely related to you the uneventful chronicle of two foolish children in a flat who most unwisely sacrificed for each other the greatest treasures of their house. But in a last word to the wise of these days let it be said that of all who give gifts these two were the wisest. Of all who give and receive gifts, such as they are wisest. Everywhere they are wisest. They are the Magi.

Question: Why did Della sell her hair?
Answer: To buy a present for Jim.
Alternative answer: To buy a watch fob for Jim's watch.