Take This Cheat Sheet To The Ballpark To Decide When To Leave:

 … baseball is not exactly packing the extra minutes [of a typically 3:05 long game] with scoring and excitement — unless pitchers jogging in from the bullpen is exciting to you. Plus, the stakes are low. They play 162 of these things. Add it all up and you understand why lines of fans hit the exits to beat the traffic home.

Of course, as any purist will tell you, a fan who leaves a ballpark early risks missing out on heart-pumping late-inning action: Just ask the owner of the car whose taillights were visible just outside Dodger Stadium as Kirk Gibson’s walk-off homer to win Game 1 of the 1988 World Series landed in the right-field stands.

We can’t advocate ever leaving early from the World Series.2 But at an average, middle-of-the-season, low-stakes game, exceptions can be made. The decision of when to exit is delicate: You want to leave games in which the outcomes are more or less predictable given the current score, but you don’t want to miss out on late-inning heroics. This decision is the kind of problem that data scientists are equipped to solve.

(Via Features – FiveThirtyEight)

Tl;dr – Leaving in the 6th inning if there is a 4+ run lead is the sweet spot.

Also, I love this stuff.