DDR3 skew matching for microstrip and striplines
So I don't clearly understand is time of flight of signal relative to impedance of trace?


It's not directly related.

Characteristic impedance of a lossless line is given by 

$$Z_0 = \sqrt{\frac{L}{C}}$$

where \$L\$ and \$C\$ are the inductance and capacitance per unit length of line.

Propagation velocity is given by

$$v=\frac{1}{\sqrt{LC}}.$$

That means that if you use different geometries that use different values of \$L\$ and \$C\$ to achieve the same \$Z_0\$, you can have different propagation velocity. You certainly can't count on a microstrip and a stripline, both having \$Z_0=40\ \Omega\$, to both have the same propagation velocity.

If you use a transmission line calculator, like Saturn PCB Toolkit or Polar, it will give you the propagation velocity as a separate output from the characteristic impedance. Knowing the propagation velocity, you can adjust the trace lengths of your outer layer traces to match the delay of your inner layer traces if you need to. These results might be slightly inaccurate due to manufacturing variations, though, so DDR layout guidelines often recommend routing all data lines associated with the same byte lane on the same layer.