Here's how the feature works. When you enter the Item Shop in Fortnite and select an item to purchase, you'll now be presented with two option: purchase it for yourself, or "Buy As A Gift." Select the latter and Fortnite will provide a second screen on which you can select a friend to send the item to. You'll be able to add a custom message if you want. Then send it off and your friend will receive a gift box with the item inside the next time they fire up the game.
It's worth noting that you can't give gifts to just anyone. Epic Games has set up a system of requirements designed to keep people from hijacking an account, buying a bunch of items and sending them to their other account. First up, you'll have to have multi-factor authentication enabled on your account to send gifts. You'll also only be able to send gifts to people you have been friends with for at least 48 hours. Finally, you can only give three gifts within a 24 hour period.
Once you decide to give a gift, the purchase is not refundable and you'll only be able to gift items that are actively available in the item shop. If you're more of a giver than a receiver, you can turn off the ability to get gifts in your Account Settings.