You have the right to a speedy trial in your criminal case under both the Sixth Amendment to the U.S. Constitution and Article I, Section 15, of the Califonria Constitution.
If this right is violated, you and your attorney can file a Serna motion (aka a speedy trial motion) asking the judge to dismiss the charges.
The problem is that there is no hard-and-fast rule for how long the prosecution can wait to bring you to trial.
For misdemeanor cases, a wait of one (1) or more year after you are arrested or a complaint is filed is an important milestone. After a 1-year delay in a misdemeanor case, a judge analyzing your case under the U.S. Constitution will presume that you have been prejudiced--harmed--by the delay. So the key question will be whether the government can offer a good excuse for the delay.
But in felony cases--or in cases that focus on the California constitutional right to a speedy trial--the Serna motion analysis is more complicated. There is no clear "deadline" for the government to bring you to trial after charging or arresting you. The judge will look at the length of the delay, but also any harm you suffered because of it and the justifications the prosecution offers for the delay, in deciding how to act on your speedy trial motion.