"The Bet" is such an interesting story that presents itself as being mostly about old vs. young and capital punishment vs. life imprisonment. The two main characters of the lawyer and the banker are the instruments of these themes.
Let's take the character of the lawyer first. He is often referred to as the "young lawyer," which is important when writing a character sketch because his age is significant. The actual bet happens when the lawyer is at a party with the banker (and other guests). A heated argument about capital punishment vs. life imprisonment ensues. In short, the lawyer agrees that, if he is able to remain in confinement for fifteen years, he will receive two million rubles. The confinement will happen in the banker's guest house (not in a prison), and the lawyer will be allowed everything from music to books to good food; however, he will not be allowed human company. The lawyer wants to prove that life, even at the lowest quality, is always better than death.
The youth of the lawyer is important as well as his problem with anger. How do we know this? Because the lawyer, without being prompted, adds ten years to his sentence! As the sentence begins, the lawyer struggles with depression, but then begins devouring books of all kinds (because the banker allows everything except contact with other people). The experience changes the lawyer. The shallow things that were important to him in the beginning (especially the money for the bet) are no longer important to him as the years drag on. Further, even without human contact, the lawyer achieves the full gamut of all emotions.
The irony is that the lawyer spends the full fifteen years having a "full" life through books and is no longer interested in money; therefore, he decides to leave only five hours early in order to lose the bet on purpose. Here is a perfect quotation to summarize the changes in the lawyer:
It is true I have not seen the earth nor men, but in your books I have drunk fragrant wine, I have sung songs, I have hunted stags and wild boars in the forests, have loved women. . . . To prove to you in action how I despise all that you live by, I renounce the two million of which I once dreamed as of paradise and which now I despise. To deprive myself of the right to the money I shall go out from here five hours before the time fixed and so break the contract.
The lawyer's "error" is in thinking that READING about experiences is the same as HAVING them. Still, the lawyer ends up valuing freedom over money.
The banker, the older of the two men at the outset, is the one who actually makes the bet with the lawyer. Further, the story is framed by the banker's thoughts about his past. When we first see him, he is pacing. When the banker thinks about his youth, we are told this:
The banker, who was younger and more nervous in those days, was suddenly carried away by excitement; he struck the table with his fist and shouted at the young man.
Again, we see a problem with anger and anxiety. At this point, even at an older age, the banker is "spoilt and frivolous, with millions beyond reckoning." True to his character, the banker impulsively bets too much money. It is this impulsiveness in the fifteen years that follow that has the banker squander his money—he will be left destitute if he pays the lawyer the winnings that the lawyer would have rightfully won. In his desperation, the banker decides to murder the lawyer, but the banker is "saved" (or perhaps I should say the lawyer is "saved") by the lawyer's own decision to reject materialism and, further, reject the money. The banker realizes that he is saved by the value of freedom over money.