An "O. Henry" ending is one that has an unexpected ending. The story "The Necklace" has such an ending in that Madame Mathilde Loisel, in her determined effort to escape her hated dull and ordinary life makes a move that she hopes will change her station for the better by borrowing her friends expensive necklace, but she ends up losing it and, in reality, she ends up ruining her life, instead by spending many years working to pay for the expensive necklace. The "O. Henry" ending comes when Madame Loisel learns that the necklace she has spent her life paying for was only a duplicate.
An "O. Henry" ending is a plot twist at the end of the story that completely changes the meaning of the storyline.
In this case, the necklace, that at first brought Mathilde such happiness when she borrowed it, and then devastation when she lost it, turns out to be a fake. When she lost it, she had no idea how she was going to replace it. After making arrangements with a jeweler, she worked herself to death to repay the cost. Her beauty, her joy, and her youth all left her because of the amount of hard labor it took to pay for what she had lost.
When she finds that the necklace she thought was genuine was merely a fake, she realized she had worked herself relentlessly for nothing. IF she had not been so covetous of luxurious things, she would still have her looks and zest for life.