Three thugs enter a Chinese wayang theater, looking for a marked man. The proprietors slip into a hidden opium den and warn a man named “Noodles”, but he pays no attention. In a flashback, Noodles observes police removing three disfigured corpses from a street. Although he kills one of the thugs pursuing him, Noodles learns they have murdered Eve, his girlfriend, and that his money has been stolen, so he leaves the city.
David “Noodles” Aaronson struggles as a street kid in a neighborhood on Manhattan’s Lower East Side in the 1920s. He and his friends Patrick “Patsy” Goldberg, Philip “Cockeye” Stein and Dominic commit petty crimes under the supervision of local boss, Bugsy. Planning to rob a drunk as a truck hides them from a police officer, they’re foiled by Maximillian “Max” Bercovicz, who jumps off the truck to rob the man himself. Noodles confronts Max, but a crooked police officer steals the watch that they are fighting over. Later, Max blackmails the police officer, who is having sex with Peggy, a teenage girl and Noodles’ neighbor. Max, Noodles, Patsy, Dominic and Cockeye start their own gang, independent of Bugsy, who had previously enjoyed the police officer’s protection.
The boys stash half their money in a suitcase, which they hide in a locker at the railway station, giving the key to “Fat” Moe Gelly, a reliable friend who is not part of the operation. Noodles is in love with Fat Moe’s sister, Deborah, an aspiring dancer and actress. After the gang has some success, Bugsy ambushes the boys and shoots Dominic, who dies in Noodles’ arms. In a rage, Noodles stabs Bugsy and severely injures a police officer. He is arrested and sentenced to prison.
Noodles is released from jail in 1930 and is reunited with his old gang, who are now major bootleggers during Prohibition. Noodles also reunites with Deborah, seeking to rekindle their relationship. During a robbery, the gang meet Carol, who later on becomes Max’s girlfriend. The gang prospers from bootlegging, while also providing muscle for union boss Jimmy Conway O’Donnell.
Noodles tries to impress Deborah on an extravagant date, but then rapes her after she declines his marriage proposal, as she intends to pursue a career in Hollywood. Noodles goes to the train station looking for Deborah, but when she spots him from her train seat, she simply closes the blind.
The gang’s financial success ends with the 1933 repeal of Prohibition. Max suggests joining the Teamsters’ union, as muscle, but Noodles refuses. Max acquiesces and they go to Florida, with Carol and Eve, for a vacation. While there, Max suggests robbing the New York Federal Reserve Bank, but Noodles regards it as a suicide mission.
Carol, who also fears for Max’s life, convinces Noodles to inform the police about a lesser offense, so the four friends will safely serve a brief (“probably one year”) jail sentence. Minutes after calling the police, Max knocks Noodles unconscious during an argument. Regaining consciousness, Noodles finds out that Max, Patsy, and Cockeye have been killed by the police, and is consumed with guilt over making the phone call. Noodles then boards the first bus leaving New York, going to Buffalo, to live under a false identity, Robert Williams.
In 1968, Noodles receives a letter informing him that the cemetery where his friends are buried is being redeveloped, asking him to make arrangements for their reburial. Realizing that someone has deduced his identity, Noodles returns to Manhattan, and stays with Fat Moe above his restaurant. While visiting the cemetery, Noodles finds a key to the railway locker once kept by the gang. Opening the locker, he finds a suitcase full of money but with a note stating that the cash is a down-payment on his next job.
Noodles hears about a corruption scandal and assassination attempt on U.S. Secretary of Commerce Christopher Bailey, an embattled political figure, mentioned in a news report.
Noodles visits Carol, who lives at a retirement home run by the Bailey Foundation. She tells him that Max planted the idea of Carol and Noodles tipping him off to the police, because he wanted to die rather than go insane like his father, who died in an asylum; Max opened fire on the police to ensure his own death.
While at the retirement home, Noodles sees a photo of Deborah at the institution’s dedication. Noodles tracks down Deborah, still an actress. He questions her about Secretary Bailey, telling her about his invitation to a party at Bailey’s mansion. Deborah claims not to know who Bailey is and begs Noodles to leave via the back exit, as Bailey’s son is waiting for her at the main door. Ignoring Deborah’s advice, Noodles sees Bailey’s son David, who is named after Noodles and bears a strong resemblance to Max as a young man. Thus, Noodles realizes that Max is alive and living as Bailey.
Noodles meets with Max in his private study during the party. Max explains that corrupt police officers helped him fake his own death, so that he could steal the gang’s money and make Deborah his mistress in order to begin a new life as Bailey, a man with connections to the Teamsters’ union, connections that have now gone sour.
Now faced with ruin and the specter of a Teamster assassination, Max asks Noodles to kill him, having tracked him down and sent the invitation. Noodles, obstinately referring to him by his Secretary Bailey identity, refuses because, in his eyes, Max died with the gang. As Noodles leaves Max’s estate, he hears a garbage truck start up and looks back to see Max standing at his driveway’s gated entrance. As he begins to walk towards Noodles, the truck passes between them. Noodles sees the truck’s auger grinding down rubbish, but Max is nowhere to be seen.
The end returns to the opening scene in 1933, with Noodles entering the opium den after his friends’ deaths, taking the drug and broadly grinning.