Or are future legal precedents only set when you go to a bench trial or a jury trial?
This question applies to both criminal and civil cases - not sure if there is a difference...
The actual order / outcome is only binding on the parties. It does not generally affect what other parties might argue or what judges might decide in different disputes.1
Precedent takes its force from the reasons given by the court.2 Where there are no reasons (as there will not be in a jury trial,3 or in a plea, or a settlement), there is no precedential value.
1. In the special case of "bellwether trials," in multidistrict litigation, the Sixth Circuit has allowed the outcomes from these early, otherwise non-binding "trials" to preclude the defendant from challeging elements of the claim in later trials with different plaintiffs, through a theory of "nonmutual offensive collateral estoppel." See E.I. du Pont de Nemours & Co. v. Abbot, 54 F.4th 912 (6th Cir. 2022), cert. denied 601 U.S. ___ (2023).
2. In Canada, this can include trial courts, where reasons from one judge can bind other judges within the same court. See R. v. Sullivan, 2022 SCC 19, para. 56. I understand that this is not the case in the United States. See the answers at this Q&A: Can a trial court create precedent?
3. Although, where the judge issues reasons relating to legal questions that arose during the trial, such as admissibility of evidence, or what the elements of the offence are, those can have precedential value. The verdict delivered by the jury, however, does not have any precedential value.
When a defendant takes a plea deal offered by the prosecutor, does that set future legal precedents?
No.
Or are future legal precedents only set when you go to a bench trial or a jury trial?
No. Indeed, the law is intentionally structured so that, given the same facts, different juries (and different judges) are allowed to arrive at entirely different conclusions. Concepts like "negligence" are intentionally devised as standards with an irreducible level of ambiguity.
The main form of precedent comes from publicly reported appellate court cases reviewing trial court rulings on the merits. The decisions are binding on courts whose decisions could be appealed to the appellate court in question, and are persuasive authority for other courts.
Most appeals in both civil and criminal cases, are from final orders at the conclusion of a trial. But some appeals are from pre-trial dispositive motions (that resolve the case prior to trial, e.g., on jurisdictional grounds) and many evidentiary rulings in criminal cases are from pre-trial motions (because there are not appeals from acquittals in a criminal case, so it is necessary to resolve them at the appellate level prior to trial).
Sometimes unreported appellate court cases and reasoned opinions of judges in motion practice or following a bench trial will be cited as precedents, but those precedents are not binding, they are only persuasive. They demonstrate that a real judge or judges adopted arguments that another real judge is being ask to adopt.
Legal precedent comes mostly from case law. That means appeals. The case could have ended in any way. Case law comes from cases that went to trial and those that ended before.
A precedent generally means one party appealed and the issue presented in the appeal might show others in a similar situation how to proceed.
Case law or precedent can be made before a case is even over. Many states allow some issues to be appealed before the case is over. That would make a precedent without a trial or agreement.
Some states and federal circuits require that the appeal be a published appeal before it can be cited.