The maxt argument here specifies the latest time that the simulation will try to estimate; any individuals with estimated event times beyond that will just have a right-censored observation at the maxt value. That's specified so that the algorithm doesn't slow down when estimating very late event times (which in principle could approach infinity).
First, be sure that you choose a maxt value that leads to no more censoring than your lowest desired censoring fraction (20% here).
Your example is a simple "Type I" censoring with all individuals followed up until the event or for a fixed period of time (5 years here) after study entry. In that case, after you simulate with a (possibly much larger) maxt value that provides no more than 20% censoring, examine how the censoring fraction changes as you alter the maximum follow-up time.
For example, if you use 2 years as the maximum follow-up time, what fraction of cases were either right-censored due to the maxt simulation limit or have simulated event times greater than 2 years? Try different maximum follow-up times until you get your desired 20%, 50%, or 70% censoring fractions. The specific time values don't matter, if what you care about is the fraction of cases that have censored observations in this simple type of censoring. The influences of sample size and censoring fractions on model quality will be the same (for any given set of betas).
Things are more complicated if you also have random censoring times, as covered in an earlier question. Then there might need to be more complicated trial-and-error that combines the random censoring model with the maximum follow up.
For the coefficients of the 3-level categorical predictor, recognize that such a predictor is modeled internally with "dummy variables." For example, if the mutually exclusive levels are cov0 (the reference level), cov1 and cov2, then the survival-analysis software would report coefficients for cov1 and cov2 while the baseline hazard would hold if the value was cov0.
So do that yourself when you simulate that predictor. Set up cov1 and cov2 variables, each of which can take on a value of either 0 or 1. Those should both be 0 if the simulated level is cov0; otherwise, set the value to 1 for the corresponding simulated level. If you want only cov2 to have different from baseline survival (after the other predictors like trt1 and trt2 are taken into account), then specify beta as 0 for cov1 and your desired log-hazard ratio for cov2.