Maxing out your buys in early Dominion
As a rule, not important. Far better to have a strategy that you follow than to buy the most expensive card you can afford.

The value of a card will vary depending on your deck, and knowing when to buy a less expensive card that your deck needs (or nothing at all) is, I think, part of the transition from a beginner to intermediate player. If there's a Chapel, it's almost always worth spending $3 on it in your first turns, as getting it early is more important than waiting for an unlucky draw with only $2. For certain kingdom sets you might not want any $5's at all, so buying one just because you have $5 would be deplorable.

Similarly, as @thesunneversets points out, Silver is often what your deck needs instead of a  $3, $4 or even $5 action if you're not hitting $6 enough for gold. Buy the card your deck most needs that you can afford!