Where I'm from, it's done at birth, it's just a standard part of a medical registration package thing your parents get. My parents kept my bloodtype card right next to my childhood vaccination records.
It can actually change in some cases. Liver transplants and bone marrow donations can trigger a change. Apparently kids a few weeks old can flip on their own as well.