I believe calculating your general odds of winning (which counting outs is one form of attempting), should serve as a good basis for your decision, but shouldn't always be the end-all; we use the math to play a factor in our decision.
Sometimes, that factor is decisive in us choosing one poker decision over another (like calling or folding to a River All-in)
However, even if the "math in our favor" sometimes I'll chose a different option based on non-math reasons. Maybe my opponent is giving off a specific tell which indicated they have a monster hand which beats me, despite how good my odds are. This is why poker isn't easy and why the game is still "beatable" in some ways.
Poker solvers might have "solved" poker in a math sense, but the card game is played by human players who are not game-theory-optimal robots. As long as this is true, then a winning player can be able to exploit the game (odds in their favor) which might not be math-based.
How much of a role this plays is debated by poker pros and poker enthusiasts alike, but they pretty much all seem to agree that it is a factor on some level. I use math to help me make my decisions, but not all of my poker decisions are 100% based on the math (things like counting outs).