Ponyboy faints after Dallas is shot by the police. In chapter 10 of the novel, Ponyboy and Dally have just found out that Johnny has died. Ponyboy does not really know what to do but Dally runs away and ends up robbing a store and being chased by the police. They corner Dally and Dally pulls a gun on them; they end up shooting Dally and this is when Ponyboy faints.
Johnny is Ponyboy's closest friend in S. E. Hinton's The Outsiders. Both boys are "greasers," the poorer boys in town who exist in a perpetual state of war with the "Socs," the wealthy boys who look down on the greasers and jump them at any opportunity. Ponyboy, the story's narrator, notes that Johnny had been badly beaten by a group of Socs and, since that traumatic event, has been a frightened child who always carries a knife. After these two young boys are again assaulted by the Socs, with one of them holding Ponyboy's head underwater, Johnny draws his knife and kills the Soc, Bob, the same individual who had led the earlier attack on Johnny.
As The Outsiders progresses, Ponyboy relates the difficulties of life with his two older brothers following the deaths of their parents. All the while, the conflict between greasers and Socs looms overhead. As readers of Hinton's novel become aware, Johnny and Ponyboy are forced to hide out, at the suggestion of Dallas Winston, or Dally, in a remote, rural, abandoned church. Dally is the meanest, toughest, and most alienated of the greasers, and Ponyboy initially holds the older, more hardened boy in relatively low esteem. It is Dally, however, who helps the boys while they are on the run and displays true loyalty and friendship.
All of this background is essential to understanding why Ponyboy faints in Chapter 10. This 14-year-old boy has experienced more than any child should, but the pain is not over. A rumble has been scheduled between the greasers and the Socs, and it is expected to be bad, with tempers boiling over because of recent events (mainly, Johnny's stabbing to death of Bob and the greasers' anger over the chain of events that led to that death). Ponyboy, however, is exhausted, physically and emotionally, and is filled with dread about the approaching fight. In Chapter 8, he describes his reaction to the coming rumble:
"I was thinking about the rumble. I had a sick feeling in my stomach and it wasn't from being ill. It was the same kind of helplessness I'd felt that night Darry yelled at me for going to sleep in the lot."
In Chapter 9, Johnny dies. Distraught, Dally flees the hospital in anger and sadness and, it emerges, robs a grocery store and is subsequently killed by the police. The confluence of events—the rumble, Johnny's death, Dally's reaction—combined with Ponyboy's growing realization that he and his brothers deserve better than this life and that the violence is all so futile—result in his increasingly weakened state, prompting the following exchange with Sodapop:
"Ponyboy," Soda said softly, like he was talking to an injured animal, "you look sick. Sit down."
I backed up, just like a frightened animal, shaking my head. "I'm okay." I felt sick. I felt as if any minute I was going to fall flat on my face, but I shook my head. "I don't want to sit down."
A little later, after Dally is shot dead by the police, Ponyboy faints. He faints because of the extraordinary amount of emotional and physical trauma to which he has been subjected in a brief period of time. His friends are dead, and he carries wounds from the rumble. In addition, he is undergoing an intellectual transformation from being accepting of the street life to expecting and hoping for more.
In Chapter 10, Ponyboy begins to feel sick as he tells the other Greasers that Johnny is dead. Suddenly, the phone rings, and it is Dally saying that he has just robbed a grocery store. The Greasers run to the vacant lot to meet up with Dally, and they witness him pull an unloaded gun out of his waistband as the police surround him. The policemen then shoot Dally, killing him instantly. Ponyboy then begins to feel nauseous and dizzy before he finally faints. The reason Ponyboy passes out is because he is both physically and mentally exhausted. Ponyboy had just participated in a rumble where he received several violent blows to the head, and has also witnessed two of his friends die in the same night. The physical and mental trauma Ponyboy is dealing with causes him to lose consciousness immediately after Dally dies.
He fainted because he just lost Johnny and now Dally. So he fainted due to the impact of it.