Countries split into recognizable camps on this. In one group, registration applies to every foreigner from day one, though hotels file it automatically so short-term tourists never see the machinery; the rule only becomes visible when you stay in a private home. A second group sets a threshold, requiring registration only for stays beyond a certain number of days, so ordinary tourists are exempt but long visits to family cross the line. A third group ties registration to visa type, obliging only long-term visa holders, students, and workers to register, with tourists excluded entirely. And some countries have no registration system at all.
Nationality can modify all of this, as certain passports face stricter registration regimes under specific bilateral arrangements, something worth checking if your country of citizenship has complicated relations with the destination.
For the NRI crowd especially, the classic trap is the long family visit: staying months with relatives in private housing, no hotel to file anything, and a threshold quietly crossed. Before a long stay, spend five minutes on the destination's immigration authority site or your embassy's country page to learn the threshold and whose duty the filing is, yours or your host's, and diarize the deadline on arrival.