Killing an enemy Hero, or assisting in one’s demise, will net you both gold and experience provided you are in the Assist Range of 3500u.
The experience you gain is based on the level of the Hero you are killing. Killing a level 1 Hero will give you +38.5, where killing a level 20 Hero gives you 427.74.
The formula is: 38.5 + [19.2608 x (Enemy Hero’s Level - 1)] = Experience Gained
Gold bounties are a bit more complicated as they factor in a base value, the amount of gold the Hero has earned, and whether or not they are on a Killstreak/Deathstreak.
The default Gold Bounty is 550. Every Hero’s bounty gains an additional 0.006 gold for every 1 gold they have earned.
Killing a Hero before they can defeat one of your teammates puts them on a Deathstreak, this reduces the bounty from killing them by -80 / -100 / -100 / -120. The minimum bounty being 330 + (0.006 Total Gold Earned).
A Hero who has defeated 3 or more enemy Heroes without dying will place them on a Killstreak, which increases the gold gained from killing them by 122 up to 8 times. When you hear the announcer say “An Enemy is EPIC!”, they have reached the maximum Killstreak and their bounty will be 550 + (122 8) + (0.006 Total Gold Earned).
Dying while on a Killstreak resets your bounty to 550 + (0.006 Total Gold Earned), and getting a kill while on a Deathstreak resets it to the same value.