If you are playing a team with an average or worse returner and its early in the game, kick it short and try to get the longer field for them to cover.
Later in the game, especially if you are protecting a lead, kick it through the end zone to prevent any chance of a momentum changing return.
Or always do it against a team with good ST and a good returner.
I don't think there is an 'all-times" right answer for this. Except if I were playing the RAMS, I would always kick it out the end zone to prevent Pharaoh Cooper from getting a shot at it!