Stuff wise, it is basically velocity, movement, command and deception that determine how good it is. But in a game, most of what determines whether a pitch is quality lies with the hitter. Sometimes the batter will be looking for a fastball when the pitcher throws one, and sometimes they'll be looking fastball when the pitcher throw a curveball. All the pitcher really should worry about is locating, because after the pitch is released, most things are out of his control. You can usually tell if the pitcher hit his spot based on where the catcher was set up and where the pitch ended up. Also, it is generally much more dangerous or less quality when the pitcher misses up in the zone rather than down in the zone, especially with breaking balls and change ups, which become very easy to hit if left elevated, especially with two strikes, when hitters may be looking for secondary pitches more often. This is what is known as "hanging" an offspeed pitch.
Also, concerning mechanics, some adjustments are to prevent injury or allowing a pitcher's delivery to become more repeatable, meaning that foot strike position, stride length, and release point become more precise. This allows for easier location of pitches, especially repeating location.