"I had known, from the time when I could speak, that my sister, in her capricious and violent coercion, was unjust to me...."See in text(Chapter VIII)
The injustice of humiliation (through verbal and physical abuse) is what eventually attracts Pip to the allure of being a gentleman. He is "morally timid and very sensitive" because his sister is abusive; he is accustomed to cruelty, so even as a grown boy he's inclined to cower instead of standing up for himself.
"The change was made in me; the thing was done. Well or ill done, excusably or inexcusably, it was done...."See in text(Chapter XIV)
Pip's "great expectations" begin with his time at Miss Havisham's. After experiencing the luxuries of upper-class life, he starts to view his own home with contempt. Pip seems to believe that being a gentleman requires wealth and a nice house.
"Many a time of an evening, when I sat alone looking at the fire, I thought, after all, there was no fire like the forge fire and the kitchen fire at home...."See in text(Chapter XXXIV)
Pip is finally (he believes) living the life of a gentleman: he has plenty of money and lives comfortably in London. The gentlemanly life is not as satisfying as Pip expected, however; he is homesick and feels guilty about how poorly he treated Joe. He unconsciously begins to question the very definition of a gentleman—a definition he will rework throughout the rest of the novel.
"“Then,” said I, “after all, stopping short here, never taking another penny from him, think what I owe him already!..."See in text(Chapter XLI)
Pip learns that his mysterious benefactor is not Miss Havisham, as she led him to believe. Instead, it is Abel Magwitch—the terrifying convict Pip helped when he was a small child. Though Pip appears to live the life of a gentleman, his fortune is rooted in criminality. Money and easy living, then, are not the only requirements of leading a gentlemanly life.
"I want forgiveness and direction far too much, to be bitter with you.”..."See in text(Chapter XLIX)
Pip is learning what it means to truly be a gentleman. Rather than being exclusively about wealth and social status, being a gentleman is about kindness and forgiveness. Pip's heart is noble: his kindness towards Abe Magwitch and (perhaps even more so) willingness to forgive Miss Havisham are his markers of gentlemanliness.
"We had a doleful parting, and when I took my place by Magwitch's side, I felt that that was my place henceforth while he lived...."See in text(Chapter LIV)
Pip's quest to become a gentleman (at least by the standard of wealth and status) has failed. However, he has learned the true meaning of being a gentleman: nobility of heart, which he displays by remaining loyal to Magwitch.