The company had just started to make money when in 1914 the World War put an end to its aspirations.
The company had just started to make money when in 1914, the World War put an end to its aspirations
Actually neither. It should be:
The reason being that "in 1914" is supplemental information, a parenthetical comment. The sentence would read just fine without the extra info.
--- Update to add --- To summarize the (rather lengthy) comments below, this Guide to Punctuation suggests that bracketing commas can sometimes be omitted. I prefer them in this instance, but I can't really argue with those who feel it reads okay without them.
However, as the guide says, you do need both the bracketing commas. Having just the one at the end would be incorrect.