There are bad and good reasons for betting in any moment in poker, but the general rule is quite simple: every time you make a bet you want it to be a +ev move, meaning that you expect in the long run a positive return of investment from the result of your action.
Good reasons to bet
Extracting value from the hand
Nothing will give you a better feeling in poker rather than betting but chunks of chips and get calls in return when you are holding the best hand possible. Besides this clear example, betting to extract value out of a hand is the way to go for building your bankroll. Players are generally bad and they tend to pay you with draws or small-strength hands, so if you have hit the board well, just bet for value and make the most of the hand.
E.g. if you are holding AK on a flop like A53 and you know your opponent is totally fine in calling three streets with a top pair with a lower kicker such as AJ or A9, wait no more and bet big. Obviously you get to know your opponents and understand well the flow of the game, otherwise you end up gifting value rather than collecting it.
Oh the mighty art of bluffing! So deep into the very essence of poker itself. Bluffing is so funny! Bluffing is so thrilling! Bluffing is… yeah stop. Bluffing is good but it has to be strictly linked with a reasoning performed in order to decide whether is right or wrong invest chips without a real value in your hand.
It’s a simple equation between risk and reward: you need your opponent to fold more often that risk / (risk + reward) % of times.
If your analysis suggests that there might be value according to the above formula, then go for it. If you feel your opponent is going to fold due to a leak or because his odds did shrink, then go for it. Otherwise, just do not invest chips in a hand just for the thrill itself of the bluff.
Bad reasons to bet
Getting info on your opponent
It’s just so wrong. You do not invest in a hand just to dig out information about the style of a given opponent or the strength of his hand. You study his style and leaks by observing him playing with other people and the strength of the hand he might have while playing versus you is not supposed to be discovered by investing money in the pot.
Betting for information doesn’t help because if you bet to “understand where you stand in hand” and get called, now you know you are beaten, but it did cost you a bet which you might have saved just checking and waiting for his move, supporting your next actions with already known information (and performing a wise fold or a big raise in bluff, for instance).
To represent a hand. “If I bet 4000 on this turn, I always represent a flush”. How many times have you heard this sentence? Answer: too many. It’s not about what you represent, it’s about your history with your opponent and his/your style; it’s about the rhythm of the session at that table and it’s about the real hand you hold.
Poker is quite simple: actions are never random and you should support yours with a good reasoning behind. Betting for the pure thrill of playing an hand is a move often shown in movies, but you are playing for building a career out of poker and not to perform in the next bollywood movie!