The line comes from No Exit, which is set in Hell. Spoilers for No Exit follow
In particular, three people who have been condemned to hell are trapped eternally in a room together. And at first they think they got off easy without any pitchforks or fiery lakes or anything. But over the course of the play they discover that they have been chosen very specifically to have neuroses and character flaws that interact with and torment each other.
Each one needs the approval of a second in an unstable RPS cycle so that any time one of them might be satisfied by a second, the third swoops in and ruins it.
And when they figure this out, one of the characters expresses his understanding, that hell isn’t physical torture. “Hell is just—other people.”
So the point isn’t that other people, generically, are hellish; it’s rather that you can build a hell out of other people.
But when I hear people quote it, it’s usually sort of an introvert-pride thing. “Other people are hell; you should spend time alone.” And that’s not the point at all. It’s a statement about how bad unhealthy relationships can be, not a statement about how all relationships are unhealthy!
“hell is other people” has always been misunderstood. It has been thought that what I meant by that was that our relations with other people are always poisoned, that they are invariably hellish relations. But what I really mean is something totally different. I mean that if relations with someone else are twisted, vitiated, then that other person can only be hell.