After looking at the episode listings on wikipedia I'd say that season 8 was very solid and season 9 is when the rot began to set in. That was the first season where two or three episodes weren't just unfunny, they were anti-funny, trying so hard to be funny that it was actually annoying. I agree with Kegg
that is was a very gradual process, so season 9 was still very good overall, and while the number of anti-funny episodes grew each year I'd still say that seasons 10-12 were good. Season 13 seemed to be the point where the good episodes were too average to outweigh the badness of the growing anti-funny episodes, but I still watched it for the occasional magnificent outing. Season 17 was the point where I gave up, it clearly wasn't going to recover and I didn't have the time to spend half an hour a week on a show I was finding more annoying than amusing.