"It...that" isn't really a pattern - your examples are about different uses of English that happen to have an "it" and a "that" in them.
"It" is often used for what's called *impersonal constructions", i.e. expressions where there is no subject, but English demands that a subject be used.
For example, in English you can't just say "Is raining." You have to say "It is raining." What or who is "it" in that sentence? Nobody - we need to insert it because verbs require a pronoun to make a sentence.
So let's look at your first example in more detail:
It is essential that we start preserving parks.
The first part is "it is essential". Again, we have an "it" because we can't start the sentence with just "Is essential" - the verb ("is") requires a pronoun ("it"). The second part is "we start preserving parks". The subject isn't the same in both parts - in the first one it's "it", in the second one it's "we". The role of "that" is to connect these two parts with different subjects. Note that we could rephrase this as
It is essential to preserve parks (or to start preserving parks).
This sentence has just one part, because there is just one subject - "it". We have no use for "that". In general, the patten we observe here looks like "It is X that Y", where X is something like: essential, important, necessary, fortunate, unfortunate, surprising, etc, and Y is a sub-sentence with its own subject, different from "it". Some examples:
- It is important that you go to school (vs. It is important to go to school)
- It is unfortunate that we won't see you at the party.
- It is obligatory that all personnel report for duty tomorrow morning.
Note that there are cases where we use something different from "that" to connect to sub-sentences, for example:
- It is difficult for me to understand English. (vs. It is difficult to understand English)
- It is forbidden for a doctor to harm patients. (vs. It is forbidden to harm patients)
Now let's look at your other example:
It must have been when I was 4 that I first met him.
The pattern you're actually seeing here is "It is/was when X that Y", as in the following examples:
- It was when everyone came together that the problem was finally solved.
- It was obviously when the new government came to power that the country took a turn for the worse.
You can rephrase these sentences in various ways:
- When everyone came together, the problem was finally solved OR The problem was finally solved when everyone came together.
- When the new government came to power, the country took a turn for the worse OR The country took a turn for the worse when the new government came to power.
This generalizes to the broader pattern "it is/was .... that ....":
- It is with great sadness that we must give you this terrible news.
- It is not unheard of that a person gets married in old age.
- and many more
That's also why the other two options you provided don't really work:
It must have been when I was 4 the first time I met him.
You're missing the "that" from the pattern, and in order to put in in the sentence, you have to also change it a bit:
It must have been when I was 4 that I met him for the first time.
Your last example is:
It must have been when I was 4 when I first met him.
Again, you are missing the "that", and you've replaced it with "when", but that sounds very odd. You can rearrange the sentence so you can use "when I first met him":
When I first met him, I must have been 4.