Johnny has given a lot of thought to the the idea of turning himself in, and has good reasons for his decision. He is tired of hiding out in the church, and thinks he has "a good chance of bein' let off easy" because he doesn't have a police record and he had acted in self-defense. Also, even though his own parents do not care about him, he knows that "it ain't fair for Ponyboy to have to stay up in that church with Darry and Soda worrying about him all the time". Dally points out that the law is harder on Greasers than they are on other people, and says, "You get hardened in jail...I don't want that to happen to you...like it happened to me", but Johnny responds, "Would you rather have me living in hide-outs for the rest of my life, always on the run?" In the final analysis, turning himself in is really the only realistic thing to do, and Johnny is wise enough to see that and courageous enough to carry it through (Chapter 6).
Johnny has a few different reasons for deciding to do this. He makes the decision after Dally comes to visit he and Ponyboy at the church. Ponyboy gets the letter from Sodapop, begging Ponyboy to come home and telling Pony how worried he and Darry are. Although Johnny knows it is vain to hope that his own parents are worried, he recognizes that Ponyboy has a family that cares about him. He wants to bring that family back together.
Secondly, Johnny believes he has "a good chance of bein' let off easy". The attack was self-defense, and it was an unfair fight - 5 against 2. He figures that, because neither he nor Ponyboy have a past record, they both should have a good chance with the courts.
I think Johnny's main reason for wanting to turn himself in is Ponyboy. He knows that Pony has a family waiting for him to come home. Pony only went to the church because Johnny was in trouble. I don't think Johnny wanted his friend to be caught up in a murder.