Iain Rice discussed this in one of his layout design articles. Here are his guidelines as I remember them:
For a shelf layout, the longest train that looked reasonable was less than 33% of shelf length.
You can't really tell how long a train is if its length safely exceeds your angle of vision; it just looks long. I believe this works out to a train length of about 10-13 ft, regardless of scale, at normal viewing distances. Most all viewers will consider the train to be "long" and have more cars than it actually does. In HO this worked out to at least 19 car trains (assuming 40ft cars) plus locomotive(s) and caboose. N would be about 35 cars to achieve the same overall length.
Extrapolating from these 2, my guideline for tabletop ovals is that train length for good looks should be no longer than the length of the "straight" track between the turnback curves. Trains that extend into the curves at both ends of the oval simultaneously tend to look toylike, and appear disproportionately large compared to the "town" they are passing through on the side of the layout. Of course, passing track limitations also apply, and often cause shorter trains than the guidelines.
These are guidelines, YMMV. Or, it's your railroad, do what you want to do.
yours in counting cars