Accepting gifts "from friends only" is an option that unlocks at the Sapphire tier of the Loyalty Program. You can read more about our loyalty program and its tiers here.
Once the feature is activated, those players who are not in your "buddies list" won't be able to send you gifts.
If you don't want to get any gifts or presents at all, you can simply remove all the players from your friends.

With the mobile version of the game, you'll need to contact our support to enable or disable this option.