Characteristic impedance is a ratio between the strengths of the electric and magnetic components of a single propagating radiowave on the line. It tells one thing of the way how the line would allow radiowaves to get transferred along the line. The characteristic impedance depends on the used materials and cross-section profile (including the dimensions) of the line. The length does not affect the characteristic impedance. It's a property of a line type, not a property of a circuit where that line is used.
In simple cases, where the line contains 2 parallel conductors, the characteristic impedance can also be calculated from the distributed inductance and capacitance of the line. To see the details search for TEM waveform transmission lines. PCB conductor lines are generally not that simple.
The complex impedance tells how a circuit behaves when it is fed from a single port. Often a piece of a transmission line is a component of a circuit and surely the chacteristic impedance of the used line type affects the measured impedance. So affect also the line length and all other connected parts.
If one measures the impedance of a piece of line which is terminated so that no reflection happens he very likely gets a result which is close to the characteristic impedance, if the line is any good at the used frequency.
You should realize that the characteristic impedance cannot be measured directly. But constructing a circuit and measuring it's impedance or s-parameters gives possibilities to see if the characteristic impedance has a certain value. As said the characteristic impedance can be calculated from the material properties and the geometry. You can find more or less accurate formulas from microwave engineering textbooks.
It's easy to make a PCB trace or other wire which does not at all work like a transmission line, but radiates the inputted signal out like an antenna, reflects it back straight away or dissipates it or all of these. In such cases one can still measure the complex impedance, but the concept "characteristic impedance" is meaningless.
If the longest line in the circuit is short enough when compared to the wavelength at the used frequency, all wave propagation effects including the characteristic impedance can be omitted in engineering. But today digital circuits use so fast pulses that they contain remarkable energy at microwave frequencies. A modern computer would't work if the signal traces in a PCB were not designed as proper transmission lines. The design is in practice possible only with high cost electromagnetic simulation software. Only a board which has one or a few fast pulse lines can be designed manually based on handbook formulas.