I'm guessing your chain and sprockets are misaligned. Try your best to align them. On my old bike, my chain fell off often, towards the inside. If it snagged on the mounting nuts and bolts, the chain would snap. I used SBP's Jump Stop, which seemed to help some.
On my next bike, I'm making a "sheet metal sandwich", using thin-gauge stainless steel larger in diameter than my 24-tooth drive sprocket. That should keep the chain from jumping off.
Orrr, you could install a larger sprocket towards the inside of your 24t sprocket, to act as a barrier.
Good luck. I know very well, how frustrating this problem can be. Try your alignment first, then the Jump-Stop.