Make fresh or refrigerate for up to 1 week is what is generally recommended for garlic-in-oil mixtures.
Marketed garlic oils are extremely controlled as garlic generally represents a risk of Clostridium botulinum presence in the food.
According to this link,
The FDA recommends that if you want to make your own infused garlic oil, you should prepare it fresh and use it right away. If you are saving any leftovers, you must refrigerate it right away and use within a week.
A link to the FDA document PDF download containing the following:
"Oil products that can create anaerobic sites of sufficient aw favorable for C. botulinum growth and toxin production are problematic; for example, the addition of fresh garlic to oil. The moisture surrounding the garlic fragments coupled with no acidulant creates the conditions necessary for C. botulinum growth and toxin production. To maintain a pH that precludes growth and toxin production, an acidulant is required in these products"
This spore-forming anaerobic bacteria is known to be extremely dangerous and lethal in small doses.
I am not saying to not play with garlic-in-oils at all, or trying to scare you out of it, but it is definitely a topic in culinary pleasure that requires research and preparation.