- When is it done?
Before you start your game. Actually, normally even before you start your game preparation such as generating characters.
If you didn't have a Session 0 with that group already, it is actually never "too late" to have it, even if you are in the middle of your campaign already. Especially if you notice problems going on (which is very possible if you didn't have a Session 0 already).
- What does it contain?
It contains pre-game discussions of what are you all awaiting from the game, what is OK, what is not OK. Session 0 is (mostly) done out-of-character. The Same Page Tool is a good set of guidelines what exactly is it a good idea to discuss, but if you want to discuss something else too, do it!
An incomplete list of what do you probably need to discuss during a Session 0:
- Are in-party conflicts OK? What to do if one happens? Can PCs leave the party and start to actively play against it?
- Does the GM have to follow the rules, or can he/she change them on fly if needed? If he/she is allowed to change the rules, what reasons are enough and what are not enough?
- Can Player Characters die? If yes, can they get killed only by a really stupid action, or can even a minor mistake lead to PC deaths?
- Do PCs play to win? To tell a story? If they play to win, what defines the victory?
- Does the GM play against the group or help it to win/tell the story?
- Is erotic role-play (ERP) OK for you or not?
- How much of your time do you want to be dedicated to combat, how much to solving puzzles, how much to social scenes?
...and actually many more things!
- Is it recommended, if not mandatory?
If you are playing with a stable group of close friends, it is possibly not needed, you already understand intuitively what does each of you want. If you don't know all of your fellow players that well, it is more than recommended to avoid further misunderstanding. If you don't know people you play with at all, definitely have a Session 0.
If your players are completely new to role-playing, though, it is likely that they will just not know the answers to most question. In this case you better have it later when you try many things with them. After each of your gaming sessions you can then ask them what did they like and didn't like, which is actually never a bad idea to ask, no matter the experience level.
- What is each person's role (DM/GM, players, etc.)?
It depends. Sometimes GM serves like a "host" of the game and actually dictates what will the game be. You either stay and play as the GM says or opt out. Sometimes your roles don't really differ and you all discuss the game on equal rights, which makes you able to come to some conclusion together. Note that this conclusion may be that some player(s) doesn't (don't) fit in the group and has (have) to leave. It is really much better to understand it earlier than later, when you are already attached to your char and the plot.
If there are players of very different experience levels, perhaps the most experienced will lead the Session 0.
- What topics are best discussed there?
See p. 2, but again, the more you discuss, the less the chance to find harsh misunderstanding later. Don't be shy to bring up anything you want to bring up.
There is no full comprehensive list of those things. It cannot exist because of a huge variety of playstyles and potential problems.
If you had problems before, bring up what has caused them so they don't show up in your next game -- because you have solved them in advance, or because you found out that it's impossible and didn't waste your time on a game doomed to be unenjoyable.