On older bikes, this is much more common.

As a bike ages, the tension in the cables that control your brakes and derailleurs slowly slackens. This means that the derailleur, which is usually sprung toward your outermost gear, isn't held in place quite as effectively as it used to be, and so, when changing into your highest gear the chain misses and you're left without a drivetrain.

If the bike is new, and the chain is falling off the chain rings at the cranks, it is most likely that the bike was adjusted with too much tension on the front derailleur before it left the shop. This is fairly common as the cables, while new, have a small amount of elasticity which vanishes fairly quickly with use and exposure to the elements.

On a well maintained bike, the chain should never just fall off, under any circumstances. That includes a full sprint from a standing start in top gear. If it does, take it to a bike mechanic.