According to FDA spokesperson Tamara Ward, butter will last up to 10 days at room temperature before turning rancid. Rancid means that enzymes that are naturally present in milk begin to digest the fats in the butter, causing a sour flavor and aroma. The butter isn’t unsafe at that point, it just tastes bad.
Be sure to keep your butter well wrapped or covered in a butter dish, however, and safe from cross-contamination from dirty knives or hands. Butter, whether it's on the counter or in the fridge, will pick up strong smells if exposed to the air.
“Butter, and every other lipid, acts like a solvent—like acetone or hexane,” says Dr. Scott Rankin, the chair of the food science department at the University of Wisconsin-Madison. Lipids will absorb volatile aroma compounds from the air. So don’t leave butter unwrapped next to onions or garlic, unless you want those flavors on your morning toast.