The big question about the ending—and the one that's kept critics arguing with each other ever since the story was published—has to do with the fact that the grandmother calls The Misfit her child and reaches out to him:
[The grandmother] saw the man's face twisted close to her own as if he were going to cry and she murmured, "Why you're one of my babies. You're one of my own children!" She reached out and touched him on the shoulder. The Misfit sprang back as if a snake had bitten him and shot her three times through the chest. (136)
What does this gesture mean in the context of the story? Unfortunately, we can't exactly answer that for you. How the ending "feels"—hopeful? cynical? depressing? zany?—hinges on how you read that moment. So too does the whole "point" of the story.
O'Connor wrote the story with a particular understanding of the ending in mind, and it's an understanding that comes from her Roman Catholic worldview. What happens to the grandmother when she reaches out to touch The Misfit is called a "moment of grace" in Catholic terminology—a special kind of gift from God, in which God suddenly fills her with almost supernatural love and understanding. That enables her to see The Misfit as a fellow suffering human being whom she is obligated to love. (Jesus commanded each person to love her fellow human beings like herself, even her enemies.)
The grandmother realizes that she does in fact love The Misfit just like one of her own children. O'Connor presents both the perception of The Misfit as a fellow human being, and the sudden but real feeling of love for him, as gifts from God. From the Catholic worldview, the grandmother, as a human being is inclined towards evil, pettiness, and selfishness, so could never have come to feel such love without God's help.
This moment of grace is hugely important in the story. The Misfit kills the grandmother, recoiling from what seems so foreign to him, but the grandmother has already had her moment of redemption. She's grown at the moment of death more than she ever did before in her life, and dies with a peaceful smile on her face.
What's more, her act may have changed The Misfit too. At the end, he says she would have been a good woman if he'd been there all her life to shoot her. This is a strange line, but think about what it means. The grandmother was redeemed by confronting evil in The Misfit, and finding the ability within herself to pity him. The Misfit's response shows that he recognizes her act as goodness, even though he recoiled from it. It's also noteworthy that in his last line he goes from claiming that the only pleasure in life is "meanness" to stating that "[meanness is] no real pleasure in life."
Killing the grandmother gave him no pleasure. Instead it troubles him. In that way, grace has worked on him too, and we might see the beginnings of a deep transformation. For O'Connor, then, the story's ending is hopeful.
Some readers (maybe you included) don't see this as an uplifting ending. You might wonder if the grandmother has lost her senses by the end of the story. It seems like she's starting to lose it when she becomes dizzy and sinks to the floor. And what of the fact that The Misfit is wearing her son's shirt? This might be what reminds the grandmother of her son, who she's just lost. Perhaps that last gesture results from delusion.
If you don't buy the "moment of grace," the story seems cynical, brutal, and bleak. Many readers don't see hope at the end of the story. And even for those who do believe "the moment of grace" interpretation there are other problems. What, for example, do we do about the rest of the family, who seem to die meaninglessly without any moments of grace? And some have a hard time with a God who only gives people moments of grace right before they die.
The ending of the story depends just as much on what's believable to you as a reader as it does on the story itself. If you believe that a miraculous moment of grace is possible, O'Connor's interpretation might be the most compelling one. If you don't, you will come to your own interpretation. Whatever the case may be, there's a lot to unpack from the ending of this story.