How do you determine which entity gains or loses an H+ in an equation?
Both of these equations are valid, as $\ce{HCO3-}$ is amphoteric (i.e. both an acid and a base). 

To answer your question, one has to consider that the $\mathrm{p}K_\text{a}$ value for $\ce{H2CO3}$ is 6.37 and that for $\ce{HCO3-}$ is 10.32. So if we started from "pure" $\ce{HCO3-}$ (let's assume sodium bicarbonate) and add it to water, what would happen? 

The $\mathrm{p}K_\text{b}$ for $\ce{HCO3-}$ is of $14 - 6.37 = 7.63$, it is larger than the $\mathrm{p}K_\text{a}$ for the acidic function (10.32). Therefore although both a weak base and a weak acid, it is a stronger base than acid, increasing the pH when added in water.