STM32 HAL_UART_Receive_IT doesn't get called for size argument of 2 or more
When characters are received, the (HAL-defined) UART_Receive_IT() is called, where pRxBuffPtr is incremented and RxXferCount is decremented. RxXferSize doesn't appear to be used. The I2C part of the library uses the same pattern, where XferSize is the total size to transmit and XferCount is limited to the batch size the hardware can handle, a potentially smaller number than XferSize. (This is not documented; I deduced it from source code.) UART might follow the same convention even though RxXferSize isn't needed in this case.

Note that if huart-&gt;Init.WordLength == UART_WORDLENGTH_9B, HAL typecasts to (uint16_t*) huart-&gt;pRxBuffPtr which requires you to align the target buffer on 2 bytes (another undocumented HAL quirk).

To debug your problem, set a debugger breakpoint in UART_Receive_IT() and make sure you know the incoming UART data, for example by monitoring the traffic with a PC terminal program and a cheap UART-to-USB converter.

One thing to look out for is correct setup of the pins in HAL_UART_MspInit() in the generated file *_hal_msp.c. Also, the relevant subsystem clocks must be activated and interrupts be enabled. Also double-check the settings for UART parity, stop bits, speed and flow control. Naturally, you need to wait for HAL_UART_RxCpltCallback() as brhans pointed out.

Usage tips: Note that waiting for a specific number of bytes is risky; you should implement your own timeout to handle corrupted or missing data instead of hanging the program. The interrupt-based calls avoid the MCU busy-looping but can miss some characters if UART speed is high and the MCU has other concurrent tasks, as the interrupt handler must be called for every character without buffering. DMA will not miss characters but also takes additional logics to get to work well, and DMA is a limited resource.

I'm personally not impressed by the HAL and find myself gradually replacing the functionality with my own higher-level API that I intend to open-source.