A computer file is a segment of bits, themselves nearly always grouped into eight-bit bytes, associated with a textual name. Notwithstanding any underlying implementation constraints, both the contents and the names of files are arbitrary, mutually independent and semantically opaque. That is:

Both the contents and the names of files can contain pretty much anything.
Mutually Independent
There is no relationship or constraints locking a file to the contents of its name (albeit erroneously implied through file name extensions).
Semantically Opaque
Neither the file system nor the operating system inspect or infer any internal structure within the files or their names (except when they attempt to do so, often with deleterious results).

Files conceptually reside in a nested hierarchy of directories, themselves usually implemented as special files whose contents consist of a specially-formatted dictionary of the names of other files and directories, connected to further clues to their physical location on the storage medium. Files and directories, potentially along with other, similar types of special file, persist on top of a file system, which is the most popular (but by no means the only) general-purpose method of permanently storing digital information.