Pip’s guilt at fighting with the pale young gentleman takes over his imagination, and he is sure he will be arrested and sent to jail forever. He also imagines Miss Havisham shooting him.
There is another answer to this, but it is not very specific so I can see why you asked it again.
When Pip meets Herbert Pocket, the “pale young gentleman” for the first time, he is completely baffled. Herbert is strange. He wants Pip to fight him because he’s bored and likes fighting, and he gives Pip a reason by pulling his hair and head-butting him.
At first, Pip is inspired by his win even though Herbert does not seem to be much of a fighter. It seems to have attracted Estella’s notice too, because she lets him kiss her.
If you look carefully at Pip’s worries, you can see that the reason he is worries is because he considers himself a lower class, and it is wrong for someone of the lower class to hurt someone of the upper class.
I felt that the pale young gentleman's blood was on my head, and that the Law would avenge it. Without having any definite idea of the penalties I had incurred, it was clear to me that village boys could not go stalking about the country, ravaging the houses of gentlefolks and pitching into the studious youth of England, without laying themselves open to severe punishment. (ch 12, enotes etext p. 66)
Pip does not want to return to Miss Havisham’s house, because he is worried that he will meet his doom there.
Whether Miss Havisham, preferring to take personal vengeance for an outrage done to her house, might rise in those grave-clothes of hers, draw a pistol, and shoot me dead? Whether suborned boys—a numerous band of mercenaries—might be engaged to fall upon me in the brewery, and cuff me until I was no more? (p. 66)
He sees his attack on the boy as a personal affront to Miss Havisham. Of course, nothing at all happens to him. It is just another example of Pip’s growing awareness of social class and his guilt.