You mean, like PDF, Jpeg, etc.?
It’s … complicated.
If there is original work in creating a file format, the best method is to patent it. E.g., MS has patented the NTFS file system and that makes it hard to people to sell, for example, removable media in that format or to write programs that directly access an NTFS file system.
Ditto some media file formats like some forms of WMV, mpeg, etc.
You can also copyright the specification and restrict access of that to certain people. E.g., the full DVD spec document can only be obtained from the DVD Forum for a large fee and signing a non-disclosure agreement.
You can also just not ever tell anyone the format and keep it a trade secret. But it’s legal to figure out a trade secret on your own. E.g., people work backwards to try and figure out MS Word’s encoding so they can make compatible programs.
An individual instance of a mpeg video and such is of course born copyrighted by whoever creates it.
In regards to computer languages, Microsoft got into trouble with J++, their version of Sun’s Java language and Sun ended up suing them. But not for copyright/patent/etc. reasons. MS had a deal with Sun to develop their own compatible version of Java, but J++ failed Sun’s tests so Sun sued and won. J++ was later dropped by MS for J# and friends. But all this was based on a prior contract.
Oracle, which bought out Sun, has been vigilant in protecting Java. They are in a long battle with Google over Google’s version of Java used in Android.
This nastiness is over the interfaces (APIs) found in function definitions and such. Google wrote their own implementations of the functions but kept the same interfaces. Oracle claims copyright on the interfaces. Google claims they aren’t really creative enough to deserve copyright protection.
For human/artificial languages, the equivalent would be sort of dictionary like. If person A copies person B’s Klingon dictionary, keeping the word list, pronunciation, etc. but writing their own definitions, that may or may not be copyright infringement. Hire a bunch of lawyers and enjoy the show.