If the other end gracefully shuts down the Socket, the Receive call will return a zero once all data has been received to indicate the end-of-stream has been reached. However, this end-of-stream condition is permanent and prevents the other end from sending any more data on the Socket.
TCP/IP is a stream protocol with no understanding of how big an logical/application-specific message is. Unless you are using the end-of-stream indication mentioned above, you need to build your own indicators into the data you send. This is sometimes referred to as "framing". For example, the sender might prefix the data with the number of bytes that follow. The receiver will first read this prefix and do a sanity check that it is a reasonable number. Then the receiver calls Receive in a loop until that many bytes have been received.
Good information on framing is available here: http://nitoprograms.blogspot.com/2009/04/message-framing.html