Before you flag this as a duplicate, let me state that the “when” in the question title is meant temporally, not conditionally.
When I've written an answer, and someone else wrote an answer which I like, but which I don't like better than my own, I tend to not upvote his answer straight away. On the other hand, once my own answer got a bit of a score, I'm willing to upvote competing answers as well. By doing so, I feel I'm expressing my own preference and still giving credit to other approaches. But this has the possible drawback that I might forget to upvote competitors if it takes too long for my own answer to gather a reasonable head start.
Should I always upvote competing answers, even if there were very few or no upvotes yet, and upvoting a competitor would place him above the answer I wrote myself and still prefer?