changing the chip from ATMega 168 to ATmega 328P

I have an old arduino clone laying around : freeduino v1.16

On this board is a ATmega 168 chip.

Can I just switch this chip with a 328P?

I tried it, but uploading doesn't seem to work anymore.
In the tools menu I also changed the chip from 168 to 328.

I get an programmer not responding error and stk500_getsync() : not in sync : resp=0x26 error

Yes you can. Make sure you bootload it as an Uno,
and then select Uno as the board type for downloading via USB/Serial.
Try the Loopback Test at the top of this forum, make sure you have the correct driver for the USB/Serial chip (FTDI? Atmega8U2 or 16U2?)

What I don't understand is that when the 168 is on the board, uploading works.
When I replace him with the 328, I get that error.

Or do I have to use another driver when using the 328?

Or when replacing the chip I have to upload a new bootloader?

I'm new to this...

You probably have to install a new bootloader, unless you specifically bought a chip with the bootloader already installed.