You may have up to seven Traits, not including any gained from magic items or your heritage trait. When you take your eighth trait, you have to swap out an old one, and there is no buy-back; it is simply lost. Traits cost 10 XP.
Now, with the bow, it's different. To gain proficiency in a new weapon group, or to gain mastery of a weapon in a group that you have proficiency in, is not a Trait and does not affect the above limits. Gaining the Proficiency or gaining the Mastery costs 8 XP. So, to gain Proficiency in Ranged Weapons takes 8 XP and allows you to roll 2d6 to hit instead of just 1d6. Once you do that, you can spend another 8 XP to gain Mastery of Short Bows in order to roll 3d6 to hit. These, again, do not impact any limits on the number of Traits you can have.