On your device, click on this link and follow the steps below:
• Tap on the … (or Share button) in the upper right.
• Tap Gift App…in the share sheet that pops up.
For Mac OS X:
As of now, it is not possible to gift Mac App Store apps directly. You could buy an iTunes Gift card (from the iTunes store home menu) for exactly the price of the app and the recipient can redeem the code in the Mac App Store.
We sell the app directly for previous Mac OS X versions so you could go to this link and use your recipient's email address when you purchase the app. It will send it directly to their email address