I absolutely agree with that, Jason. But I think rather then saying "I want to be with this company x years," possibly say "At some point, I want to move from x to a management position" or "I want to get a graduate degree in 3 to 4 years." This kind of transparency can encourage incentives to keep you around: Partial or complete tuition reimbursement if you take night classes, for example.
Again, not always feasible if you don't know what you want yet or if you're in the wrong environment, but a good strategy when it works </tautology>
In other words, this advice might work out if you're the kind of person who will think "I want to work for this job for about x months/years and then move on to something else". But not everyone thinks that way.
Regardless, +1 for being clear about your intentions up front. You can't go wrong that way (for most jobs).