Woody prepares to go to cowboy camp with Andy, but Andy nearly rips Woody’s right arm off, which leaves it paralysed. Andy decides to leave Woody behind, and Andy’s mother puts Woody on a shelf. The next day, Woody discovers Wheezy, a penguin squeaky toy, has been shelved for months due to a broken squeaker. When Andy’s mother puts Wheezy in a yard sale, Woody rescues him, only to be stolen by a greedy toy collector, who takes him to his apartment. Buzz Lightyear and all of Andy’s other toys identify the thief from a commercial as Al McWhiggin, the owner of a toy store called Al’s Toy Barn. Buzz, Hamm, Mr. Potato Head, Slinky Dog, and Rex all set out to rescue Woody.
At Al’s apartment, Woody learns that he is a valuable collectable based on a 1950s TV show called Woody’s Roundup and is set to be sold to a toy museum in Tokyo, Japan. While the other toys from the show-Jessie, Woody’s horse Bullseye, and Stinky Pete-are excited about going, Woody wants to return home because he is still one of Andy’s toys. Jessie is upset because the museum is only interested in the collection if Woody is in it, meaning they will return to storage if he is absent from the collection. When his arm is torn off accidentally, Woody attempts to retrieve it and escape but is foiled by someone mysteriously turning on Al’s television set. The next morning, a cleaner repairs his arm and Woody learns that Jessie was once the beloved toy of a child named Emily, who eventually outgrew her and gave her away. Stinky Pete warns him that the same fate awaits him when Andy grows up, whereas he will last forever in the museum. This convinces Woody to stay, now believing that all toys eventually get discarded by their owners.
Meanwhile, Buzz and the other toys eventually reach Al’s Toy Barn. While searching for Woody, Buzz is imprisoned in a cardboard box by another Buzz Lightyear action figure with a utility belt, who thinks he is a real space ranger, like the original Buzz from the first film. The new Buzz joins the other toys, who mistake him as their Buzz. After discovering Al’s plan, they arrive at his apartment while Buzz escapes and pursues them, accidentally freeing an Emperor Zurg toy, who immediately goes after him, intent on destroying him. After the toys find Woody, Buzz rejoins them and proves that he is Andy’s Buzz, but Woody refuses to go home. Buzz reminds Woody of a toy’s “true purpose” and warns him that in the museum, he will only be able to watch children from behind glass and never be played with again. After seeing a boy play with him on the TV, Woody changes his mind and asks the Roundup toys to come with him, but Stinky Pete prevents their escape.
Having foiled Woody’s escape the previous night, Stinky Pete reveals that he wants to go to Japan because he was never sold to children, allowing Al to take the Roundup toys with him. Buzz and the gang follow Al, but are caught by Zurg, who battles the new Buzz until Rex knocks him down Al’s apartment. The new Buzz then chooses to remain behind with an injured Zurg. Accompanied by three toy Aliens, Andy’s toys steal a Pizza Planet delivery truck and follow Al to an airport, where they enter the baggage handling system and free Woody. Stinky Pete rips Woody’s arm again while preventing his escape, but is stuffed into a little girl’s Barbie backpack by Andy’s toys to teach him a lesson of what it is like to be played with. They free Bullseye, only for Jessie to end up on the plane bound for Japan. Assisted by Buzz and Bullseye, Woody frees Jessie and the toys find their way home.
When Andy returns from camp, he accepts Jessie, Bullseye, and the Aliens as his new toys, thinking his mother bought them, and repairs Woody’s torn arm. Meanwhile, Al’s business has suffered due to his failure to sell the Roundup toys. Woody tells Buzz that he is not worried about Andy discarding him because, when he does, they will still have each other for company. Wheezy’s squeaker has been fixed and he performs a Frank Sinatra-style version of “You’ve Got a Friend in Me”.