The OCA2 gene plays a crucial role in determining the pigmentation of the skin, hair, and eyes by influencing the production of melanin. Mutations in this gene are primarily associated with oculocutaneous albinism type 2, a condition characterized by reduced melanin synthesis leading to lighter skin, hair, and eye color, and vision problems.