I have read in some posts that when one enrols as a voter in the USA you can nominate which party you are aligned with, and register accordingly. Is this correct? and what is the purpose of that?

Here in NZ one is free to join and vote for whatever party one likes. The government and its agencies have no official means of determining one's alliances, which seems like a good idea to me.