The exact procedure would depend on the rules of the university - at the ANU, you can register majors at any point in 2nd year or later, and if you don't register a major before your graduation, the faculty office will determine it automatically.
well even as early as first year you should pick subjects with majors in mind... enrollment guides will give you info/advice/planning stuff about that... but of course if you change your mind later you can do the extra subjects needed for your chosen major...