Were you in your big front chainring by any chance? If so, being in the big front/big back combo is a no-no, and can lead to the chain jumping off. You should shift to the middle or smaller chainring in front before shifting to the largest rear sprocket while in the biggest front chainring.

If this does not apply, then your chain may be stretched or your derailleur may need adjusting. You can start by cleaning and lubing the whole drivetrain. Sometimes that will help all by itself.

Be sure to check that your rear wheel is properly seated and is not misaligned in the dropouts. It might be best to remove the wheel and reinstall it fresh. Your brake might be crooked, too. Cleaning the drivetrain will help regardless.