This is your friend code on which you can share to get others to friend you and you can post your code on the Friends page.
Gift CodeThe present item is not a gift but is used to redeem codes that Gameloft posts on Instagram, Facebook. You can also find them hidden in the loading screen. You can get various gifts like Gems, decor, a Character, a Shop (but that is very rare on happening), & other stuff. You can check Gift Code for active codes.
Star Mastery is a feature where you get rewards for leveling up your characters. The more characters you level up, the more rewards you will get from it. If the character is already at Star Level 5, than that will count as well.