When is the `rules: if` clause evaluated?

Quick question: when is the expression of the rules: if clause evaluated?

Is it at the time of pipeline creation, or at the time a job is about to be scheduled to run?

Searched through the docs section - looks like it’s not mentioned.