How to decide if I should use a counterspell in MTG?
Considering your link to Solar Flare builds, I'll assume you're talking about the Standard format as of right now.

The timing of your counters relies heavily on what deck your opponent is running.  To some extent, it does rely on knowing your opponent's deck, but most Standard decks fall into an archtype.  Recognizing those archtypes isn't too difficult if you spend some time in the format, and recognition means you'll know what some of the more commonly-run threats for those decks are.

Assuming your opponent is running aggro and is effectively racing to see if they can take you down before you can start to get some of your meaner cards (traditionally Sun Titan into a Liliana via Unburial Rites, etc.), you need to be able to survive their early game.  This may mean throwing counters away early on, on things that could build into bigger threats (e.g. Lord of the Unreal, Phantasmal Image, Stromkirk Noble, etc.) to slow them down.

Assuming your opponent is running control, you're looking for bombs and other counters.  They're doing the same thing as you; playing the waiting game, looking for the opportunity to get something game-winning through.  This often means a slow game, where each player will play a land and then pass, leaving mana open for counters and their-turn fun (like White Sun's Zenith, Blue Sun's Zenith, and Forbidden Alchemy).

Midrange decks are much harder to gauge - you'll often have to play a game before you get a good feeling for what their bombs are, what you're watching out for.

Lastly, one of the strongest things you can do is threaten a counter.  Whether or not you have one in hand (and whether or not you're even playing them, if you're still playing blue), if you leave mana open for a counter, they may not play a more threatening card for risk of it getting countered.  Never let your opponent feel comfortable - even if you've played three Mana Leaks, what's to say you don't have another counter (Dissipate, Negate, etc.), or destruction, or a Snapcaster!  For this reason, I'd caution against tapping out, as you lose this threat entirely.

One more note - there's a reason Snapcaster Mage is so popular! Every Snapcaster (ideally used) means another Mana Leak, Dissipate, Doom Blade, Go for the Throat, or Dismember that you've already used once.