Has it always been a problem or is this something new?
If it's always done it, could be something assembled wrong or mfg defect.
Take the bar and chain off, look things over carefully, look for a worn or bent bar, something caught up in the bar, the sprocket for wear, the sprocket alignment with the bar.
Does the chain stay tight? If it backs off, could be a problem with the tensioner or the nuts not tightening down correctly on the bar. Be sure the bar sits flat against the case, nothing caught up under it or a screw backed out keeping it from sitting flat and tightening down.
Hold the chain stretched out between your hands, bow it side to side, it should bow the same both ways. If it has been run on a bent or misaligned bar it may be worn in such a way it favors one side and will continue to jump off even if the root cause is corrected.
Check the sprocket shaft for front to rear, and in and out play. If the bearing is bad the sprocket will be misaligned.