If I buy a gun and run out of ammo how can I get more of it?
You either pick it up from Soldiers dropping that weapon or just rebuy the Weapon from the Black Market. When you touch it's case, it just refills your ammo if you have that weapon equipped.
There are also weapon stashes around military bases where you can replenish for free.
There is no way to obtain Ammo for Weapons introduced by DLC's outside the Black Market since NPC do not use them.
There are some Mods around which give you unlimited ammo etc, but you have to decide yourself if you want those.