Gauge theory compactified on an orbifold is defined by gauge symmetry, matter contents, and boundary conditions. There are equivalence classes (ECs), each of which consists of physically equivalent boundary conditions. We propose the powerful necessary conditions, trace conservation laws (TCLs), which achieve a sufficient classification of ECs in U(N) and SU(N) gauge theories on T2/Zm orbifolds (m = 2, 3, 4, 6). The TCLs yield the equivalent relations between the diagonal boundary conditions without relying on an explicit form of gauge transformations. The TCLs also show the existence of off-diagonal ECs, which consist only of off-diagonal matrices, on T2/Z4 and T2/Z6. After the sufficient classification, the exact numbers of ECs are obtained.