As with most things, it all depends on the railroad.
Most railroads try (with varying degrees of success) to keep locos of the same make and model in a single number series. This can get confused when mergers and lease agreements add more locos to the pool than the original numbering plan provided for. Also, some railroads renumber locomotives into a new series when they are upgraded or modified from manufacturer's stock configuration.
My prototype included the class designation within the unit number, so there was never any confusion about exactly what a given loco was.
Short lines, and the PRR in its heyday, seemed to assign numbers more or less at random, frequently assigning the number of a retired loco to its fresh from the erecting floor (or connecting Class I) unit.
To find out exactly how a given railroad assigns (assigned) locomotive numbers, the best source of info is that line's historical society. Almost every significant railroad has one, and many are on-line.
Chuck (modeling Central Japan in September, 1964)
bawbyk wrote:How does a Railroad decide on numbering of locomotives? I notice that there seems to be constant renumbering -- at times of sale and at times of upgrading.
There is apparently no rhyme or reason behind how railroads number their equipment. UP has two sets of numbers (UP and UPY) to cover their needs! But, some one, some where in the staff of all of the big 7 roads knows why equipment is numbered the way it's numbered.