It was customary to enumerate them by branch of service. In other words, a separate enumeration between regiments of infantry, artillery, cavalry, engineers, etc.
For example the United States Army, which existed at the time of the war's commencement, included ten regiments of infantry, numbered 1 to 10, four of artillery, numbered 1-4, two of cavalry (1st and 2nd), two of dragoons (1st and 2nd), and one of mounted rifles. During 1861 more regiments were added to the regular Army and numbers were assigned upon organization in continuation of their number among their branch.
In April, 1861, President Lincoln called forth 75,000 Militia from the States for three months active service. These regiments where newly assembled from their militia were by some States designated with new numbers, like the 1st, 2nd, and 3rd Connecticut regiments (3 mos.); while New Jersey designated them 1st-4th Regiments of "New Jersey Foot Militia." Meanwhile other States employed existing volunteer Militia regiments entire for this service, like the existing 7th New York National Guard.
The US soon called for 3 year volunteer troops, and most Union soldiers served in such units. The volunteer force followed the regular army mode, in generally numbering the regiments by State and by branch of service. In Connecticut, they continued enumeration beyond the 3 mo. regiments from the 4th Volunteer Infantry (3 yrs.) up. In others, they went from 1st up... For example New Jersey, which raised besides its 1st Regiment of Foot Militia (3 mo.) raised volunteer units designated from 1st Regiment of New Jersey Volunteer Infantry, up. But very generally somewhat like the regular army's mode.
The Southern Confederacy generally followed the same general mode.