The number three is a magic number that is often used in "The gift of the Magi". For example:
There are three main characters: Della, Jim (Della's husband), and Madame Sophronie (who buys Della's hair). Della and Jim are two poor people living in New York City. They want to buy each other nice gifts for Christmas but do not have the money to do so.
When Della is gloomy, she is described to be sitting at the window looking at a gray cat climbing a gray fence in a gray backyard. The color gray is usually associated with gloom. The author doesn't tell us how Della is feeling, but we can guess it from what she's looking at.
The chops that Della and Jim want to eat are of no particular importance, yet the author mentions them three times.
At the beginning of the story, Della has only one dollar and eighty-seven cents. She counts her money three times before deciding to sell her hair to get a gift for Jim.
This constant repetition of the number three keeps the reader interested and wants to find out what happens next to the characters.