How long can I be required to serve on a jury?

As long as it takes. Some trials last only a few hours, others a day or two, and some trials can last even longer. Before a lengthy trial, it is likely that the judge will ask you whether you have any problems that could prevent you from serving on such a jury. It will then be up to the judge to decide whether you have a valid excuse from service.