No one can tell in advance how many times or how long you will have to be in court. The process of justice takes time. The number of times you may be called to appear in court and the delays you may encounter are the result of many factors, including pre-trial motions or other scheduled events with your case, or congestion on the judge's court calendar.
The stages involved in processing a criminal case are summarized on our Anatomy of a Prosecution page. In general, your first and only appearance for misdemeanor offenses will be for the actual trial. In a felony case, the first time you appear as a witness may be for the preliminary examination. On rare occasions, pre-trial motions by the defense attorney or by the prosecuting attorney may require additional hearings before the trial begins, which may require witness testimony.