All the Pretty Horses opens with sixteen year-old John Grady Cole mourning the death of his mother's father. Since his grandfather had only one child - John Grady's mother- his death means that the Grady name is buried forever. It also means that the ranch on which he's lived on his entire life now belongs solely to his mother.
An aspiring actress who spends little time in San Angelo, Mrs. Cole decides to sell the ranch. John Grady confronts his mother at dinner, begging her not to sell the property, but she rebuffs his appeal, claiming that the ranch yields no money and that he's too young to run it. John Grady appeals to his father and family lawyer for help, but both make it clear that his mother will determine the fate of the ranch.
His mother is often gone in the months that follow. One night, he journeys to San Antonio to see her act in a play. He watches hoping to find meaning in it, but finds "nothing in it at all." Convinced to part with his dreams of running the ranch, John Grady decides to leave San Angelo with his best friend Rawlins. He goes for a last ride with his father, makes peace with a past girlfriend, and then, on a cold spring morning, rides with his friend into the country.
John Grady and Rawlins's journey towards Mexico is both idyllic and unhurried. One afternoon, however, John Grady tells his friend that he's noticed a rider behind them - they're being followed. The rider turns out to be thirteen year-old Jimmy Blevins. Brash and precocious, Blevins manages to charm Rawlins and John Grady into letting him accompany them as they ride towards Mexico, despite the fact that he's clearly riding a stolen horse.
They ride on for several days and stop to buy liquor from some passing caravans of migrant traders. Blevins gets especially drunk, panics when a lightning storm approaches, and gallops off on his horse. When John Grady finds him later, Blevins has lost his clothing - all of which he'd stripped off because of its metal fasteners - his pistol, and his horse. John Grady gives him his spare shirt and takes him up onto his horse.
They ride into Encantada where they see Blevins' pistol sticking out of the back pocket of a man and find Blevins' horse in an abandoned mud house. The next morning, they recapture the horse and storm out of town. To evade the pursuing riders, they split up. Blevins flees from the town on the paved path, Rawlins and Grady head into the country.
John Grady and Rawlins get jobs as cowboys at the Hacienda de Nuestra Senora de la Purisima Concepcion, a ranch run by Don Hector Rocha. Though Rocha is skeptical of their motivations for coming to Mexico, he entrusts his sixteen horses to the two Americans and dares them to tame the wild animals. Not only do they accomplish this, but the two men slowly ingratiate themselves into the La Purisima family. John Grady begins to fall in love with Rocha's daughter, Alejandra. His affections become public when he meets her one evening by the lake, while riding Rocha's prized stallion. He agrees to let her ride the stallion, even though he knows somebody will see him riding back on her Arabian and draw conclusions about their relationship.
Soon after, John Grady is invited to meet Duena Alfonsa, Alejandra's grandaunt. They play chess over tea and she insinuates that she does not want him involved with Alejandra. Still, he doesn't reject Alejandra's advances when she visits him late one night in the barn. She tells him that someone had seen him ride her Arabian on the night they met at the lake and that her grandaunt found out about it. Neither of them take Alfonsa's warning seriously, however, and they become nighttime companions, riding their horses by moonlight. She starts coming to his bunk when everyone else is asleep.
Rocha invites John Grady to his home again and tells him that he is sending Alejandra to France. A week or so later, Rawlins and John Grady return from the mountains but find no sign of Rocha. The next morning two men in uniform burst into their bunks with guns and arrest them. They take Rawlins and John Grady away from the ranch, towards the north.
For three days, John Grady and Rawlins ride behind the uniformed officers, cuffed to their horses. On the third day they ride into Encantada, the town where they found and rescued Blevins' horse. They are taken to a small jail and thrown into a cell with a third man who turns out to be Blevins. Blevins tells them that after they left Encantada and split up, he worked for a German family in Palau for two months. With the money he'd earned, he rode back across the desert, returned to Encantada and shot the man who stole his pistol. He was caught by the authorities, who immediately went searching for his accomplices.
The next morning, Rawlins and John Grady are taken to meet the captain who accuses them of being horse thieves and conspirators with the 'assassin' Blevins. Three days later, they are loaded into a truckbed and driven to an abandoned estancia near Torreon. After they're taken off the truck, the guards grab Blevins by the arm, drag him into the trees, and shoot him. The guards return and drive Rawlins and John Grady to an old prison in Castelar. The captain enters their cell and makes it clear that they will not be leaving the jail until they pay their way out.
For the next two days, the two Americans are left in la periquera, the prison yard, to defend themselves against their bloodthirsty jailmates. On the third day, the fighting intensifies - John Grady is blindsided with a gravel-filled sock that knocks out two teeth and leaves his left eye completely closed. They are invited to meet with a man named Emilio Perez, who offers to help them get out of the prison with the help of his political connections. But when John Grady and Rawlins tell him that they have no money to pay, Perez lets them know that they are doomed. Those who are not "under his protection" do not survive.
Rawlins is stabbed the next day by one of the convicts. John Grady returns to Perez, but Perez will not help him without money. Knowing that he must take matters into his own hands, John Grady convinces one of the convicts to sell him a makeshift switchblade. That night, a young boy attacks him at the evening meal. John Grady pulls out his knife and the two men engage in a protracted, bloody battle. Finally, John Grady manages to stab him in the heart and kill him. When he walks into the yard, bruised and bloodied, a man approaches and tells John Grady to follow him: Perez wants to help him. John Grady collapses and the man rescues him just as the prison alarm sounds. Soon after, both he and Rawlins are released. Duena Alfonsa has given the money needed to pay their way out. Rawlins heads home to San Angelo, John Grady back to La Purisima.
Seven weeks after being captured, he finds his way back to the ranch. He finds out that Rocha took Alejandra to Mexico City and never said when he would return. He returns the next night to meet Duena Alfonsa. She chastises him for coming to the ranch and tells him that she only paid his way out because Alejandra promised never to see him again. John Grady accuses of her of inflicting the bitterness of her own life on her grandniece. Duena Alfonsa responds by telling him that he knows nothing of the circumstances of her own life and then by recounting the tragic circumstances of her own lost love. She leaves, insisting that Alejandra will not break her promise to her.
The next morning he calls Alejandra who agrees to meet him in Zacatecas. They have dinner in a hotel where he tells her everything that happened. Finally, she confesses that she is responsible for everything: she told her father that they were lovers. The only reason Rocha didn't kill John Grady himself was because he was afraid his daughter might take her own life. The lovers spend the night and the next day in each other's arms. At night, he takes her to the station and can barely watch as the train pulls away.
He rides for days until he reaches a crossroads. Seeing an arrow point towards La Encantada, he suddenly becomes determined not to leave his horses in Mexico and decides to return to the place where they were impounded. He waits for the captain in an old schoolhouse and takes him at gunpoint to the horse corral. As he forces the captain to help him wrangle the four horses - his own, Rocha's, Blevins', Rawlins' - he is shot from behind. Unable to finish the job on his own, John Grady unhitches the captain and tells him to follow on Rocha's horse, warning him that to attempt an escape is sure death. They soon lose their pursuers as they leave Encantada and ride on towards the north.
They ride and stop intermittently. The captain begins to lose his verve, begging John Grady to let him go. Eventually John Grady takes pity on him and sets him free. Days later, he rides into Langtry, Texas. He searches for the owner of Blevins' horse, but never finds him. Later in the month, he drifts north back to San Angelo. He rides to Rawlins' house and tells friend everything that has happened. He finds out from Rawlins that his father has died.
He remains in San Angelo for a short time and attends the funeral of Abuela, the woman who had worked for his family for fifty years. But then, just as before, he leaves without a destination. He crosses the Pecos River and vanishes "into the darkening land, the world to come."