Andy prepares to go to cowboy camp with Woody, but accidentally tears Woody's arm during playtime. Andy leaves without him, and Woody later finds Wheezy, a squeeze toy penguin with a broken squeaker. When Andy's mother puts Wheezy in a yard sale, Woody rescues him from being sold, but is stolen in the process by a greedy toy collector named Al McWhiggin (the owner of Al's Toy Barn). At Al's apartment, Woody learns he is based on the main character of a 1950s TV show called Woody's Roundup and, along with Jessie, Bullseye, and Stinky Pete the Prospector (the other characters in his show), they are set to be sold to a museum in Tokyo, Japan, but Woody intends to return to Andy, much to Jessie's ire. Prospector explains the museum is only interested in the collection if it is complete, and without Woody, they will be returned to storage, which triggers Jessie's claustrophobia. Al accidentally rips Woody's arm off completely while planning a photograph of the Roundup gang, so he calls a toy cleaner to come the next morning to fix him. That night while Al is sleeping, Woody attempts to retrieve his arm and escape, but his attempt is sabotaged when Al's television turns on, waking up Al in the process, and he angrily blames Jessie when he finds the TV remote in front of her. The next day, the toy cleaner arrives and reattaches Woody's arm. Woody discovers that Jessie once belonged to a girl named Emily, who eventually outgrew her and gave her away. Prospector warns Woody the same fate awaits him when Andy grows up, whereas he would last forever in the museum. Woody decides to stay, much to the delight of the others.
Meanwhile, Buzz, Hamm, Mr. Potato Head, Slinky Dog, and Rex set out on a mission to rescue Woody in Al's Toy Barn. While searching for Woody, Buzz is imprisoned in a cardboard box by a Utility Belt Buzz Lightyear action figure, who believes Buzz is a rogue space ranger. Utility Belt Buzz then joins the other toys, who mistake him for Andy's Buzz. After discovering Al's plan, they enter his apartment building through the elevator shaft. Andy's Buzz escapes and pursues them, but accidentally frees an Evil Emperor Zurg action figure, who follows Buzz with the intent of destroying him. The toys find Woody and Buzz rejoins them, but Woody refuses to go home. Buzz reminds Woody that a toy's true purpose is to be played with, which he would never experience in a museum. Woody realizes Buzz is right, and asks the Roundup gang to come home with him and the other toys. However, Prospector refuses and reveals he was actually responsible for foiling Woody's earlier escape attempt, as he wants to go to the museum, having never been sold to children, loved, or played with. Al then returns, puts the gang in a suitcase, and departs for the airport. Andy's toys pursue Al, but are caught in the elevator shaft by Zurg, who battles Utility Belt Buzz and reveals himself to be his father. Rex inadvertently knocks Zurg off of the elevator. Utility Belt Buzz chooses to remain behind with Zurg, while Andy's toys, accompanied by three toy Aliens, steal a Pizza Planet delivery truck and follow Al to the airport, where they sneak into the baggage handling system and find Al's suitcase. Prospector rips Woody's arm and threatens to take him apart if he tries to escape, but Andy's toys subdue the Prospector and place him inside a little girl's backpack. They free Bullseye, but Jessie ends up on the plane bound for Japan. Assisted by Buzz and Bullseye, Woody enters the plane and frees Jessie, allowing them to escape before it takes off, and they return home. Andy returns from camp and accepts Jessie, Bullseye, and the Aliens as his new toys, then repairs Woody's arm, while Wheezy's squeaker has been fixed as well. As the rest of the toys celebrate, Woody tells Buzz he is no longer concerned about Andy outgrowing him, as they will still always have each other for company.