X-Robots-Tag is an HTTP response header that carries the same kind of instructions as a robots meta tag. HTTP, the Hypertext Transfer Protocol, is how a server sends a page to a browser or crawler, and each response includes headers that describe it. When one of those headers is X-Robots-Tag, the server is passing indexing instructions along with the file.
The main reason to use it is that a header does not need to live inside the file. A meta tag can only go in an HTML page, but a PDF, an image, a video or a downloadable document has no HTML head. A header lets you apply noindex to those. It is also handy for applying a rule to many URLs at once, because you can set it in server or hosting configuration for a whole folder or file type instead of editing every page.
The header looks like this: X-Robots-Tag: noindex. It can carry other directives too, such as telling search engines not to show a cached copy or a snippet, and it can be limited to a single crawler by naming it first.
A common mistake is setting it and then not being able to see it. The header is invisible in the page source, so check it with browser developer tools, a command-line request or a crawler tool. As with the meta tag, the crawler has to be allowed to fetch the file, so a Disallow rule that blocks the URL stops the header from ever being read.
An example: a server adds this header to every PDF in a downloads folder, keeping them out of search.
Related: noindex, Disallow, duplicate content