Holden is obviously depressed for much of the story and he explicitly states his wish to commit suicide at the end of Chapter 14, following his run-in with Maurice the pimp:
I felt like jumping out the window. I probably would've done it, too, if I'd been sure somebody'd cover me up as soon as I landed. I didn't want a bunch of stupid rubbernecks looking at me when I was all gory.
The only reason why he doesn’t top himself at this point, according to him, is that he doesn’t want to run the risk of making a spectacle of himself; he fears that all the stupid phonies won’t leave him alone even in death. However, it is unlikely he would have killed himself in any case, as although he appears to despise other people, he still has connections to them. In fact, he is even able to say, at the end of the story, ‘I think I even miss that goddam Maurice’ (chapter 26). Really he needs other people and he needs to be part of society; it is just that he is going through a very confused stage, common to adolescence, of trying to adjust to the adult world and find his place in it. Most of all, he needs and cares for his family, and doesn’t ever want to do anything to hurt them. He often gets very low, and it is not surprising that he should be feeling particularly bad after being beaten up by Maurice, but he is not genuinely suicidal, even at this point.