Characters are upgraded by buying items using the gold you primarily earn from killing minions. If you get the killing blow when you fight a minion you will recieve a bonus and if your character is nearby when a minion dies you will also get a small amount of gold.
Another way to get gold is to go into the area between the lanes which is refereed to as the 'Jungle' and killing the monsters that spawn at specific intervals there. Defeating these monsters will also earn you experience. You can also earn gold and experience by killing enemy players, the amount you recieve is dependant on the situation but it will be a substantial amount at any stage. Fights throughout the game are heavily influenced by how much gold and experience either team has collectively gained.