Among Holden's many character traits is indecisiveness. Here is a young man, not unlike Hamlet in this regard, who finds it difficult if not outright impossible to make a firm decision and stick to it.
Like Hamlet, Holden contemplates suicide as an escape from a world that has become nothing more than a vale of tears. But again like Hamlet, he doesn't go through with killing himself, not least because that would involve making a firm decision, something Holden has often shown himself to be incapable of.
At the risk of indulging in armchair psychology, one could argue that Holden's expressed wish to commit suicide isn't really genuine; it's just an immature reaction to an unpleasant situation.
Not everything in Holden's world is unpleasant, whatever he might say. As well as his beloved sister Phoebe, he has Jane Gallagher in his life, a girl for whom he has romantic feelings, as well as being one of the few people he knows who isn't actually a phony. Holden may have put Jane on a pedestal, making her somewhat less real as a consequence, but she's real enough to make a positive difference to his life all the same.
So it seems that Holden has something worth living for, something that makes it unlikely that his apparent desire to take his own life has any real substance to it.