Why does Sammy quit in "A&P"?
Sammy's decision to quit in the middle of his shift at the A&P is not necessarily driven by a single factor.
It is important to consider when the story was written. Social mores and relationships between teenagers and adults were beginning to change when Updike wrote the story in 1961. Sammy's decision to stand up to Lengel when he mistreats the girls in the grocery store is fueled at least in part by his growing dissatisfaction with the homogeneous, suburban consumer culture exemplified in national brands like A&P. Sammy considers the other customers "sheep"—thoughtless followers with their HiHo crackers and herring snacks. His rejection of the A&P and what it embodies would, in this case, precede the girls' arrival.
Sammy's decision to quit could also be a manifestation of his transition from boyhood into manhood. He could be standing on principle while at the same time hoping for approval and gratitude from the girls. He could be rejecting Lengel's values—that girls must not wear bathing suits in public. There likely is not a single reason that motivates Sammy, and Updike likely did not want Sammy's decision to be simplistic and transparent to the reader.
The answer above may be correct, but I do not think that this is really what Sammy is thinking. To me, he is not thinking about what he wants to be in the future or anything like that. When I read this story, I go back to being a teenager and I know what I would have been thinking in Sammy's place -- I would have been thinking that maybe I could impress these girls and get one or more of them interested in me.
I think that teenage boys are (or at least were in my day) way more interested in the slightest possibility of sex than in what their future might hold. Because of that, I think that Sammy is being purely driven by hormones and mental pictures of Queenie, in particular" as his girlfriend.
My only evidence for this (other than my own memories) is this line:
The girls, and who'd blame them, are in a hurry to get out, so I say "I quit" to Lengel quick enough for them to hear, hoping they'll stop and watch me, their unsuspected hero.
Sammy makes his sudden decision to quit for reasons that he does not articulate. Probably, however, his thinking (paragraph 21) is based on fears that he might eventually develop into a carbon copy of Lengel if he does not begin asserting himself on matters of principle. His explanation to himself is summed up in paragraph 31 with his observation that it would be "fatal" not to go through with his gesture. In other words, his sense of identity is on the line and he must maintain his integrity in his own eyes even if the girls know nothing about his action. He realizes that the world will be hard for him "hereafter" because people like Lengel may always be gaining economic or arbitrary power over him, and therefore he may feel future pressure to suppress his integrity.
Sammy from the story "A&P", quits because he is hoping that the women will come to him as a hero. He is hoping that they will be pleased with his actions so much that they will give him sex. He wants to feel like a hero and in his mind he has this imagination that since he practically "saved" them that they will reward him. Sammy is a young man who does have crazed hormones. John Updike wanted to show in this story, how against women he is. Women were not even given a voice until halfway done with story. A man is given a voice in the first page. Just comming from a feminist point of view, Sammy only quit looking to be looked as manly.