"How do jams like these work? Is the total time you're allowed to spend on it 2 weeks (the submission period), or are you allowed to work on it even before the jam starts?"
Thats basically it. Some people do work on there's before the jam even starts, which I dont consider cheating, but I do find it more fun to start with the jam.
I hope that answered your question.