The cutoff is 100 episodes, which traditionally is a magic number for US syndication deals. An ongoing series with 100 episodes under its belt will get a good deal for everyone involved.
Most traditional series will hit that number in 5 seasons, but obviously nobody wants to make a deal for a dead series; so you produce season 6 too, to make it palatable. By this point, however, your talent bill has probably grown significantly, so making new seasons is less and less profitable - as well as narratively hard. So you pull the plug and start afresh.