Almost by definition, the answer varies from jurisdiction to jurisdiction.
Colorado, for example, has a statute establishing some boundaries on the authority of local governments to establish criminal and quasi-criminal ordinances (e.g., limiting that maximum penalties that can be imposed) and the state supreme court in Colorado has adopted a couple of sets of procedural rules for municipal courts in which municipal ordinances are enforced.
Sometimes procedural and substantive rules related to ordinance violations are set forth in the laws of the government whose laws authorize the formation of the entity, while in other cases, limitations and rules related to these ordinance violations are set by the municipality itself.
Some jurisdictions have very formal municipal court systems with detailed procedures and judges with similar qualifications to state judges in courts of general jurisdiction (or have no separate municipal court system at all). Other jurisdictions are very loose, and have decisions made by non-lawyer judges in relatively informal proceedings with few formal procedural rules.
Often, in jurisdictions with less formal processes, an appeal of an initial adverse decision of a municipal court is by a trial de novo, which means that a dissatisfied defendant can have a do over in a new trial in a more formal court setting.
The details like when on offense occurs, when it has to be charged, and the like, also depends on both the kind of conduct regulated and on the kind of relief sought by the municipality.
For example, Colorado has a one year state level statute of limitations running from the date that construction is completed on claims to fine, incarcerate, or order of tear down, of a structure completed in violation of building codes or HOA covenants, which is shorter than the statute of limitations established by state law for some other kinds of ordinance violations and specifies clearly when the statute of limitations clock starts running. But a Colorado municipality can still deny future building permits if past work done in violation of building codes for which a statute of limitations for prosecuting an ordinance violation or ordering a tear down has run, until the past work is up to code.
Unfortunately, since the sources of law are highly fragmented and differ from one jurisdiction to another, and because these issues are often not litigated to the point where they become precedent making reported decisions of appellate courts, legally researching these issues is often challenging. Even finding a copy of the relevant municipal codes and municipal court procedures is often a non-trivial matter, especially in rural areas and in poor municipalities that haven't had the funds to make this kind of information available online.