Pip goes to Cairo and Estella marries someone else.
There are two endings of the book. Charles Dickens was advised by a friend to make the ending a little happier, so he revised it. However, in both endings Pip and Estella do not get together.
In the revised ending, we are told that Pip has “no shadow of another parting from her” but this is not an indication that they get together. The conversation between Pip and Estella indicates that.
“… I have been bent and broken, but—I hope—into a better shape. Be as considerate and good to me as you were, and tell me we are friends.”
“We are friends,” said I, rising and bending over her, as she rose from the bench.
“And will continue friends apart,” said Estella. (Ch. 59)
When Pip returns to Satis house, it is being demolished. Estella is there overseeing it, and she will build on the site. After Drummle died, Pip was aware that Estella had married again.
Pip tells Estella that he still lives abroad. He never married. Herbert married Clara, and Joe married Biddy. Joe and Biddy had a son they named Pip. Pip came back to visit them.
Pip and Estella agree to remain friends. However, Pip will still live in Cairo and Estella has her own life. It is a happy ending in that the two of them have settled into life and are doing well enough, even though they cannot be together.
Readers should appreciate that both Pip and Estella are broken psychologically. They have done as well as could be expected as adults after their difficult childhoods. An ending where Pip and Estella marry would not make sense. Estella told Pip she could not love. Pip loves her, but understands that he can’t have her. He has to be content with them being friends apart.