How to design an STM32 board with UART over a USB connection?
You can't connect the UART Rx/Tx directly to the DP/DN signals on the USB connector.
You basically have two options:

Add software to your application to use the USB peripheral on your STM32 to implement a virtual COM port. ST has some example projects for this, so it isn't terribly difficult, but will likely take some software time to implement. I think there is example software here: https://www.st.com/en/embedded-software/stsw-stm32121.html. In this case, you would wire the USB pins on the STM32 to the USB connector.

You can buy a chip to provide a USB-to-UART bridge. FTDI makes several versions of this, such as this one: https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf
This requires an extra chip, but it is probably the easier option to get working. In this case, you would wire the UART pins to the Rx/Tx pins of the FTDI chip, and then wire the USB pair on the FTDI chip to the USB connector.

I guess there is an option 3, as well. You could buy a USB to TTL UART cable and connect this to your board, instead of putting the USB connector on your board, if you wanted to get as simple as possible with both software and the PCB design. FTDI cable assemblies: https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm.