"and all that" is a colloquial (informal) expression which is more-or-less synonymous with "et cetera", can be used as a filler, makes what precedes it more vague, or means something akin to "everything connected with the subject mentioned"
To split your sentence into relevant clauses:
The shellfish belongs to past ages
when the whales were land animals
and all that.
The "and all that" in this sentence is using the "everything connected with the subject mentioned" meaning and is modifying "when the whales were land animals", pointing out that the author is also including all the other things that happened when whales walked on land without having to explicitly mention them in the sentence.