The first one is used for agreement, and the second is used for assurance. Both of these terms came from gambling and betting money.
When somebody says "I bet", they are basically saying "I believe that. In fact, I would wager money on that." Essentially the speaker is saying they have confidence that what you are saying is true. On the other hand, people sometimes use this expression to mean the exact opposite through sarcasm. Generally, the tone is different when it is using sarcastically.
When somebody says "you bet", they are basically saying "I assure you that what I'm saying is true. In fact, you could wager money on it"
Some examples to help clarify:
Person 1: "The weather gets really cold in Alaska this time of year. I nearly froze with this thin coat"
Person 2: "Wow, yea, I bet. You need to get a thicker coat next time."
Person 1: "Could you come hold this ladder for me so I don't fall while changing the lightbulb?"
Person 2: "You bet. Just let me take my gloves off so I can get a better grip"
Hope this helps :)