Which office handles it varies by country, and that's genuinely the first thing to look up for your destination, because three different systems exist. In much of continental Europe and East Asia, it's the municipal or city hall level, a civil registry or residents' office where you appear with documents and walk out with a registration certificate.
The document set is fairly consistent across systems: passport, visa or residence permit, proof of the address, usually the signed lease, sometimes a specific landlord confirmation form that the landlord must sign, and a completed registration form.
Three practical tips: book the appointment before you even move in where booking systems exist, because big-city slots can run out beyond your legal deadline, though showing a booked appointment usually protects you; ask specifically what the landlord must provide, as missing landlord paperwork is the most common reason people get turned away; and guard the certificate you receive, since banks, employers, and permit renewals will ask for it repeatedly.