In this context, "det" does mean "it". Directly translated the question reads: "Is it seventh time they are swimming together?", however in English it is read: "Is it the seventh time they are swimming together?". In Norwegian, the "den" in between the "det" and "sjuende" is optional. In this context, the "the" for us is kind of like how Norwegian sometimes requires a "for" before an infinitive verb. In English, the "the" is necessary to make sense in "Is it the seventh time they are swimming together?", but in Norwegian, "den" is not necessary to make grammatical sense, at least before an order adjective.