Step One: Schedule the Event
Find a 45-60 minute window where your team can fully concentrate on the challenge. Organize it when the participants are not frustrated or stressed and don't need to run back to work quickly.
Marshmallow challenge has been organized for as few as four people to groups with nearly a thousand people. If it's the first time you're managing the exercise, start with fewer people first.
Have some idea how you will form the teams; it can help have a smoother start. If people need to self organize at the beginning of the exercise, they might experience frustration, especially if they don't know each other. I found it helpful to ask the participants to organize themselves in groups before the meeting. Alternatively, you can ask the participants to pull numbers from a hat and assign them to teams based on the number. You can also use the existing team structure or just define the teams yourself. Choose the way that works best for the participants.
If possible, have the same number of people on each team.
There's no hard rule for team size; if you want to improve the current team culture, you can use similar to your existing team sizes. However, make sure the teams are not too big. Groups of 4 to 6 members usually function efficiently.
Organize the meeting in a room where you can provide each team with a stable table and sufficient space around each table.
Don't mention in your invitation that the exercise is about the marshmallow challenge. It would spoil the surprise.