Answer:
The procedure is different in different jurisdictions, but it is pretty universally handled by an agency of the government. Sometimes it is through an Official Records department or Vital Statistics department, and sometimes through the courts. In Britain name changes are accomplished "by deed poll".