Unsurprisingly, there is a rule of criminal procedure at the federal level, rule 16. It is complicated, but here are the broad strokes of that requirement.
There are a number of requirements of government disclosure (a), and then there are defendant's disclosure rules (b). If defendant requests, the government must disclose defendants statements, also the defendant's prior record, documents and objects, test results. There is also a duty to disclose w.r.t. expert witnesses. Specifically excluded are government-internal documents regarding the investigation or prosecution (things that won't be introduced at trial), and grand jury transcripts. There are conditions and exceptions within the exceptions: all of these obligations are "if the defendant requests".
The defendant must disclose certain documents if the defendant requests and the government complies under Rule 16(a)(1)(E) which is the government's obligation to disclose objects. Then
the defendant must permit the government, upon request, to inspect and
to copy or photograph books, papers, documents, data, photographs,
tangible objects, buildings or places, or copies or portions of any of
these items
if the defendant has it and intends to use it. There is a similar requirement to report test results in his possession that he intends to use, if he has so requested of the government, and also expert witnesses have to be disclosed. Not subject to disclosure by the defense are
anything statement-like made by or to the defendant or his attorney by defendant, a witness or a prospective witness (on either side). This is pre-trial discovery. Rule 26.2 applies during trial:
After a witness other than the defendant has testified on direct
examination, the court, on motion of a party who did not call the
witness, must order an attorney for the government or the defendant
and the defendant's attorney to produce, for the examination and use
of the moving party, any statement of the witness that is in their
possession and that relates to the subject matter of the witness's
testimony.
So the government or defense must comply with that order as well.
"Surprise witnesses" are allowed. The party discovering such a witness must be genuinely "surprised", so a party can't deliberately suppress information that they have a eyewitness and a photograph, but if they discover such evidence late in the game, it can be admissible.