Hoghead gave the best answer, and I can tell he is the genuine locomotive engineer!
How many cars a train can pull is a poorly asked question. A "train" by official definition is an engine with or without cars with a dispatcher-issued clearance and showing a marker (usually a red flag or red light). A yard engine is not a train unless it has received a clearance and displays a marker. When I ran helper engines "light over the hill" to help another train, I had a clearance form and displayed a rear headlight to serve as my marker.
There is an additional term called "string-lining". Southern Pacific had a great railroad until they were changed in corporate structure over to SPTC (Southern Pacific Transportation Company), and all of a sudden Harvard and Yale management types came to tell experienced railroad executives how to run a railroad! (ahem.)
Up in the Shasta line and around Redding California, the "new management" got the bright idea of not using the helper formula: add the road locomotive horsepower to the helper horsepower, divide that into the total weight of the train for the tons to be handled by each engine (an engine is one or more locomotives multiple-unit connected), and then the mid-train helper pulls 2/3 of its assigned tonnage and shoves 1/3 of its assigned tonnage. The "new management" decided it was stupid having two crews, so they put all of the horsepower on the "head end".
The result is that the overpowered head end locomotives pulled the cars in the first part of the train right off the tracks and into the lake! Take a piece of string (from which this term comes from), put it in a u-shape. Now pull one end. Does the string follow around in line? No. It pulls straight. That is what happened to the trains. This is a key to just one factor as to how much of a train that locomotives can pull.
Another is air brakes. I've run one 250 car train, and whenever you touch the automatic air brake handle, you absolutely have to stop the train completely before you can release the brakes and recharge the train before moving. There is no way you can release the brakes at the rear of the train until you wait about a half hour for the compressors to recharge the air brake line.
The Louisville and Nashville ran a 500 car coal train with one road engine and five helpers. They could not keep it moving due to normal air leaks in the trainline. As soon as the train would move, several miles up the line the cars would undulate and the gladhands would leak and the brakes would set up. Unlike trucks, with railroad trains, you lower the brake pipe air pressure to set the brakes, and you increase the brake pipe air pressure to release the brakes, a really great safety mechanism. This is done through what is called an "automatic brake valve" located in each engine and car to route air to each car's air reservoir, but I will not get into the technicalities of that.
On Southern Pacific's Los Angeles Division between Los Angeles and Yuma Arizona and West Colton to Bakersfield, we pretty much were limited to around 125 cars and ten locomotives per engine. Helpler engines rarely had more than four locomotives or units and usually went mid-train, sometimes "on the point". Behind the caboose, we could not have more than twelve axles powered. Sometimes we did have almost 150 cars over Beaumont Hill, but very rarely, and always with mid-train helpers.
Another factor not related to horsepower or tractive effort is the railroad's physical characteristics and traffic density. Can a long train be safely run from one end of the division to another without causing a conflict due to the train being longer than a siding? The crossover for Mons Siding and Fingal Siding were connected together so that the two sidings were made into one very long passing track. Sometimes, with two moderate size trains and the right timing, on the downhill train we could enter Mons Siding and "get in the clear" and slow way down and make a running meet without stopping at the bottom of Fingal Siding, provided we had a clear understanding with the dispatcher, and, it was usually the dispatcher who called us over the radio to set the move up.
I think that Hoghead gave the best and most accurate basic explanation, however.
a.k.a. Libris Fidelis