In Chapter XVIII of Great Expectations, Pip is visited by Mr. Jaggers, whom he recognizes from his being at Miss Havisham's once. The barrister tells Pip that he has "Great Expectations. Then, he sets down the stipulations to this announcement and offers to pay Joe Gargery for Pip to be released from his apprenticeship.
After Mr. Jaggers departs, Joe sits pensively before the fire with Pip joining him:
The more I looked into the glowing coals, the more incapable I became of looking at Joe; the longer the silence lasted, the more unable I felt to speak.
When Pip finally asks Joe if he has told Biddy of his fortune, Joe replies that he left this to Pip. But Pip insists, so Joe tells Biddy who congratulates him, but, like Joe, has some sadness in her voice. Then, Pip says that he will order his new clothes and keep them at the shop of Trabb, the tailor. There he will change before taking the coach to London so that he will not be stared at--"such a coarse and common business--that I couldn't bear myself." But, despite Pip's airs, Biddy asks him if he would not "showing" himself to Mr. Gargery and his sister and her, after all. To this, Pip agrees, but with some resentment. Biddy and Joe go outside while Pip goes into his little room which now appears as
a mean little room that I should soon be parted from and raised above forever.
As he raises his window, Pip espies Joe outside; Biddy brings him a pipe and lights it for him
He never smoked so late, and it seemed to hint to me that he wanted comforting, for some reason or other. I drew away from the window...feeling it very sorrowful and strange that this first night of my bright fortunes should be the loneliest I had ever know.
I put my light out and crept into bed; and it was an uneasy bed now, and I never slept the old sound sleep in it any more.
Despite his good fortune, Pip considers how lonely he will be without his father-figure, Joe, whom he loves and who loves him dearly. Also, Pip is sorry for the ingratitude that he has shown Joe, who has released Pip from his apprenticeship and who merely wants to see Pip dressed as a gentleman before he parts.
You need to give more information -- what does he mean by what? You don't say.
If you are talking about the beginning of the novel, when Pip has just learned he has a benefactor, Pip is unhappy because he will have to leave Joe and Biddy. Even though he is excited about his good fortune, he knows his life will be totally changed and that Joe and Biddy most likely will not fit into it.
If you are talking about the middle of the novel, Pip is unhappy when despite the fact that he is well on his way to becoming a gentleman, Estella is still incapable of loving him due to her dysfunctional upbringing by Miss Havisham.
If you are talking about the end of the novel, Pip is unhappy because he has learned that it is Magwitch, the convict, that is his benefactor, not Miss Havisham and in spite of all the money Magwitch has given him, Pip learns, in the end, that money has not really made him a gentlemen in his soul -- because those things he values have nothing to do with his "great expectations" but the love and devotion of Joe and Biddy, who loved him when he was just Pip and not "Mr. Pip, Sir."
Please repost your question with the specific item you are referring to if this is not enough information.