When should one invite co-authors? To my understanding, there are pros and cons to inviting (well respected) researchers to co-author a paper.

Pros: Being a co-author with well-respected researchers puts one in a good light. They can make valuable contributions. You improve your chance of being invited to work on projects with them in future. All these points can advance one's academic career.

Cons: Too many cooks spoil the broth. There is more chance of conflicting idea and styles, which might lead to frustration and delayed publication. They might not contribute as much as you hoped. More authors means less credit for the work per author.

I would like to hear your views on this.
When you "invite" co-authors is when the project is still in the formation phase - as early as possible. Authors are people who contributed to the project, not people whose names might power a paper past reviewers. And the reasons for their invitation should be substantial and scientifically valid reasons.

One thing to note is that after the project starts is potentially a bad time, as presumably you don't necessarily have the budget to pay them, the potential for them to be genuinely engaged in a question they're interested in is a bit of luck, and you've lost out on the chance for their expertise to to actually influence the formation of the project (where it's probably most helpful).

It's absolutely not appropriate to invite them at the paper stage.

For reviews or commentaries, it might be acceptable to do this before the paper begins to be written, but for other papers, co-authors should not simply be added to a project at the writing stage. Indeed, doing so violates a large number of authorship guidelines.

I'd also like to contest one of your cons: "More authors means less credit for the work per author." This is highly field dependent. In my own, noone cares, or tries to divide credit by number of authors.