From what I've seen, with all else even:
shorter passes have higher completion %, give up less sacks, and force the defense to tackle to keep it a short gain. Long passes are completed less %, give up far more sacks, but do go for big gains. Medium is decent in all aspects and doesn't have any huge pro's or cons. Decent completion %, you'll give up a few sacks, completions usually go around 8 ish yards.
Someone might throw short if their OL can't hold up a rush, or if they think their pass receivers can out maneuver the defense after the catch.