Garlic usually does best if it's cooked quickly and over medium heat. About thirty seconds will do the trick. This is just enough time to cook off the rawness, allow the flavor to mellow into the dish, and let the aroma to hit its peak. You'll know it's done when you can smell the garlic and your mouth starts watering!
When should garlic be added when sauteing?
Just wait to add the garlic until the onion's almost done. Even when you start slow, that garlic cooks fast.
Should garlic be sauteed first?
The general rule is onions first. Sauté the garlic towards the end for 30-ish seconds before removing from the heat. As ElendilTheTall correctly pointed out, garlic can scorch quickly, especially if you tend to sauté on the hot side (as I do).