That's totally up to the protocol you use.
The serial connection on itself is just a stream.
It has already been mentioned that sometimes a CRLF is used as a separator, but since you mention raw binary data, it depends on whether you have control over the sender.
* You could send the length first, then the raw data, so on the receiving end, you will first read the length, then the according number of bytes.
* You could define a magic, but then you need to escape that magic if it appears within the actual data.
...
Or you don't have control, in which case the documentation of the sender will hopefully include some kind of protocol definition that helps you recognize the end.