The longest recorded Major League Baseball at-bat happened in 1988 when Bartolo Colon of the Cleveland Indians threw 20 pitches to Ricky Gutiérrez of the Houston Astros. Gutiérrez took two strikes and three balls and fouled off 13 pitches before striking out on the 20th pitch.
There may have been earlier at-bats that extended beyond the 20 pitch record, but pitch counts were not kept by statisticians before 1980. Luke Appling is unofficially credited with a 24-pitch at-bat in 1940. In 2012, Miguel Cabrera of the Detroit Tigers had an at-bat last roughly 9 minutes due to a complaint over the placement of batter's box. The grounds crew were forced to re-chalk the box before he could finish.