When you sign up for CoPilot, there's a settings section on Github for it. One option you can toggle is "Allow GitHub to use my code snippets for product improvements *".
Context still needs to be processed, so surrounding line, block, and a couple open tabs gets piped into the prompt.
And here's a quote from the privacy page.
> Depending on your preferred telemetry settings, GitHub Copilot may also collect and retain the following, collectively referred to as “code snippets”: source code that you are editing, related files and other files open in the same IDE or editor, URLs of repositories and files path.