To use the fly cheat you will need to bring up the command line by hitting the tab key. If you have never entered cheats before, you may need to type in "enablecheats" and hit enter. Leave out the "" by the way. Next, simply type "fly" then enter, and you will be on your way. To stop flying type in "walk" on the command line and hit enter.
Of course, you will have to make sure that you are not too high off the ground, otherwise, you will take damage when you land.
You are not invincible when flying in Ark. Wild dinos will still be able to bite you, you will still suffer from the effects of heat and cold. Interestingly it seems you don't lose oxygen underwater though. When using the fly command while riding one of your dinos, both you and the dino will be able to fly. While riding on creatures, the turning radius seems greatly reduced. Also, be careful, Ark Survival Evolved can be glitchy, and using commands seems to increase the chance of something going wrong. It is a good idea not to be using your best gear, or best dino while using the fly command or other cheats for that matter.