Shelob survives the initial encounter with Sam, and Tolkien indicates that she may have eventually fully healed herself.
Sam deals some pretty serious damage to shelob, piercing her underside, blinding her eyes, and cutting her legs. Shelob flees inside to nurse her wounds, leaving a trail of blood.
Now splaying her legs she drove her huge bulk down on him again. Too soon. For Sam still stood upon his feet, and dropping his own sword, with both hands he held the elven-blade point upwards, fending off that ghastly roof; and so Shelob, with the driving force of her own cruel will, with strength greater than any warrior's hand, thrust herself upon a bitter spike. Deep, deep it pricked, as Sam was crushed slowly to the ground.
No such anguish had Shelob ever known, or dreamed of knowing, in all her long world of wickedness. Not the doughtiest soldier of old Gondor, nor the most savage Orc entrapped, had ever thus endured her, or set blade to her beloved flesh. A shudder went through her. Heaving up again, wrenching away from the pain, she bent her writhing limbs beneath her and sprang backwards in a convulsive leap.
...
No such terror out of heaven had ever burned in Shelob's face before. The beams of it entered into her wounded head and scored it with unbearable pain, and the dreadful infection of light spread from eye to eye. She fell back beating the air with her forelegs, her sight blasted by inner lightnings, her mind in agony. Then turning her maimed head away, she rolled aside and began to crawl, claw by claw, towards the opening in the dark cliff behind.
Sam came on. He was reeling like a drunken man, but he came on. And Shelob cowed at last, shrunken in defeat, jerked and quivered as she tried to hasten from him. She reached the hole, and squeezing down, leaving a trail of green-yellow slime, she slipped in, even as Sam hewed a last stroke at her dragging legs. Then he fell to the ground.
The Lord of the Rings - Book IV, Chapter 10 - "The Choices of Master Samwise"
We know however that Shelob did not die immediately, because a little bit later Sam hears her still around making some noise.
As before, Sam found that his hearing was sharpened, but that to his sight the things of this world seemed thin and vague. The rocky walls of the path were pale, as if seen through a mist, but still at a distance he heard the bubbling of Shelob in her misery: and harsh and clear, and very close it seemed, he heard cries and the clash of metal.
The Lord of the Rings - Book VI, Chapter 1 - "The Tower of Cirith Ungol"
Tolkien as the narrator explains that Shelob could have still survived, and provides a sort of explanation as to how, but says that "this tale does not tell" if it happened or not.
Shelob was gone; and whether she lay long in her lair, nursing her malice and her misery, and in slow years of darkness healed herself from within, rebuilding her clustered eyes, until with hunger like death she spun once more her dreadful snares in the glens of the Mountains of Shadow, this tale does not tell.
The Lord of the Rings - Book IV, Chapter 10 - "The Choices of Master Samwise"
Furthermore, as best as I can tell, none of Tolkien's known time schemes, outlines, or earlier drafts of this encounter explicitly say whether Shelob was killed or not, so I do not think Tolkien ever gave a definitive answer here. Either she eventually died of her wounds or she didn't.