When and where to shift depends rather on your current skill set. As a handwaving rule, a position that avoids splitting a sixteenth figure (usually one beat) and/or tied phrases across several strings is a good position.
However, this rule will throw a beginner into second and fourth position more often than they care for. More handwaving gets involved when you have to cross several strings anyway: in that case a particularly voicing may be intended (for an extreme example, take a look at the Bach solo partita #3, prelude where there are obvious 3-string passages climbing around in higher positions on the A and D strings interspersed with the empty E string, or at the violin concerto #1 A minor where the third movement (in 9/8?) has several 3-string passages).
The Brandenburg Concerto #3 uses violins as lead instruments in a chamber music setting. That's less demanding and exposed than solo instruments.
I think that the Schott (or Peters?) edition of the violin concertos suggests two fingerings (a better one above the notes, an easier one below), but that would not necessarily hold for the Brandenburg concerti. Personally, I prefer uncluttered Ur editions and figuring stuff out on my own and just pencilling in what isn't obvious on the fly.