In Updike's "A & P" a number of situations cause the protagonist to leave his job.
First, the narrator sees his co-worker, Stoksie, who has been stuck in the same dead-end job at the supermarket for five long years. Stoksie is 22, "married, with two babies chalked up on his fuselage already." The narrator is 19. The effect is for the young man to feel the burden of passing time. He fears being stuck just like his friend, with obligations that he can no longer escape. This realization in part, causes him to make the decision to leave.
A second "cause" of the narrator's seemingly rash departure is his desire to impress Queenie and her friends. Belittled by his manager, and feeling beholden to his parents, the narrator defends the girls' actions and appearance by saying "I quit" to Lengel, quick enough for them to hear, hoping they'll stop and watch me, their unsuspected hero."
The effect of this action is to sail the teenager into unfamiliar waters: disappointing his parents, leaving a meager but steady income, and not knowing whether the girls know or even care about his heroic deed.