In a large and growing number of countries, SIM registration is legally mandatory: you show your passport, the seller records or scans it, and in some places adds a photo of you, biometrics like fingerprints, or your visa and entry stamp details. A shrinking set of countries still sells anonymous prepaid SIMs with no ID at all. Assume registration is required and carry your passport when SIM shopping; a photocopy sometimes suffices but the original is safer.
Activation timing depends on the process. At official carrier stores and airport counters, registration is done in front of you and the SIM typically works within minutes, occasionally up to a few hours for the systems to sync. SIMs bought from convenience stores in registration countries may need a separate activation step, via the carrier's app, a website upload of your passport photo page, or a shop visit, which can add hours or a day, so buy from a proper counter when you need connectivity immediately.