I always have trouble figuring out how long to saute garlic for before adding it to a dish. How do I know when it is ready?
Not long at all. Usually 1 minute is enough.
If it starts to turn brown, it's been in there too long.
Exact time depends on the heat of the pan how you've cut the garlic (thick slices can go much longer than thin slices or minced), and if you're cooking it on its own, or with something else -- if you toss it in at the same time as onion, you're much less likely to burn it, but you might not get the exact same flavor out of it as it wasn't subjected to as high of heat.
When it's on its own (or with only crushed red pepper), minced, and the olive oil was shimmering when it went in, I maybe give it maybe 30sec before I toss in something else to cool down the pan.
If you saute the garlic by itself it really doesn't take very long--depending on the heat of your oil it can take from just a few seconds to a minute. It burns easily so you need to watch carefully, but I've found smell to be the best indicator that it's done--as soon as you smell that strong garlic scent it's ready even though it often won't look much different. Large pieces or whole garlic cloves are done (but not yet overdone) when they just start to turn brown, but with small pieces brown means burnt.
If you saute your garlic at the same time as (or after) the onions or other ingredients you won't get that strong scent and your garlic flavor will be less intense, but your garlic is also much less likely to burn. In these cases it's usually best to focus on whether the other ingredients are done to your liking and let the garlic take care of itself.
Start with olive oil in a cold pan. Add the minced garlic. Prepare whatever you wish to be added in advance. Turn on the heat to medium. Just keep smelling it. Once the harsh scent has gone away, and before it starts to get any more than slightly golden brown, add the other stuff to reduce the pans temperature. The garlic will be flavorful, but not acrid or burnt. You're on your own from there