Chain loses grip under load in higher gears
The comments above are probably correct; if your chain is new, then the issue is likely a worn cassette. Because they wear out as a pair, chains and cassettes are often replaced simultaneously. A new chain on an old cassette can lead to skipping, just like an old chain on a new cassette can lead to skipping. 

Another possible cause of "losing grip" could be a damaged or missing pawl inside the freehub body's ratcheting mechanism. If, for example, one out of your three pawls is chipped or has broken off, the freehub will engage fine under light load, but heavier force (like pedaling hard in higher gears) can cause the hub to "freewheel" briefly in the wrong (pedaling) direction.