In most operating systems, “a file is a file is a file” and there is no distinction between text files and binary files at the operating system level. The Microsoft Windows (and, earlier, DOS) family is a notable exception.
In general, there is neither a “beginning of file” nor an “end of file” marker of any kind in the file itself: when you open a file, the file pointer is positioned at the beginning of the file; when the end of the file is reached on reading, EOF
(usually -1) is returned, but this is done automagically by the OS when it reaches the end of the file (which it knows from the file's size), not because there is any kind of marker in the file itself.
A vaguely related concept, which you might be interested in, is the idea of “file magic”. Different file formats (JPEG, PNG, PDF, etc.) typically use a number of bytes at the beginning of the file to identify the file type and version (all PDF version 1.5 files, for example, begin with “%PDF-1.5\n”). There is, unfortunately, no standard for this, so there are occasionally “collisions”, where two distinct file formats can have the same “magic”. The Linux/Unix utility file
uses a database of file magic to identify many file types successfully from the initial bytes, but it is not always successful for less common file types