For example consider C6
[C-E-G-A] and Am7
[A-C-E-G] which share the same notes in different order.
When we play
[E-G-A-C] how is it called?(is this a inversion of C6 or Am7)
Generally, how are these distinguished?
When you play E-G-A-C, it can be called a variety of names:
You would use the above in a chart if you need a specific bass note, typically for an ascending / descending bass movement.
Otherwise, they are just generally called C6 or Am7, and you may want to specify that it is C6 1st inversion or Am7 2nd inversion.
When to write C6 vs. Am7 depends on the harmonic role of the chord. In a C major tune, you are more likely to see a C6 chord. In a G major tune, Am7 chords are common (as part of a II-V-I progression: Am7 D7 G)