STM32 USB - Delayed transmit when payload length = 256 (or 512, or 768...) bytes?
except if the data length is an even multiple of 256 bytes


Its 64 bytes actually (MaxPacketSize). USB bulk transfers "end" with transfers that are not MaxPacketSize - normally 64 bytes long. If your transfer is an integer multiple of that, you send a zero packet after the data.  This signals the transfer end to upper USB software stacks, which will return your data at once.

Most VCP example code omits this for simplicity.