The max length of IP datagram is 65,535 Bytes which includes 20 Bytes fixed header(min) and IP payload. So the max size of IP payload(TCP segment) could be 65,535-20=65,515 Bytes
TCP header is fixed 20 Bytes(min). So max TCP payload is 65,515-20=65,495 Bytes