Standing curfews for the general public are rare in stable countries; where you will encounter time-based restrictions, they usually apply to specific things rather than everyone's movement. Common examples: alcohol sales cutoffs, noise ordinances after certain hours, parks and beaches closing at night, minors' curfews in some cities, and restricted zones near borders or military areas. So in most destinations you can walk around at midnight legally, with personal safety rather than law being the real consideration.
Genuine curfews appear in specific circumstances: states of emergency, civil unrest, natural disasters, security operations in particular regions, and a handful of countries or provinces with ongoing conflicts where nighttime movement bans are standing policy. These are exactly what government travel advisories exist to flag, so check your foreign ministry's advisory for the destination and any specific regions before you travel, and register with your embassy for alerts if visiting anywhere volatile.
Once in-country, local sources beat everything: hotels know current restrictions cold, and any active curfew will dominate local news. If one is declared while you are there, take it literally, keep documents on you, and stay in touch with your accommodation about safe hours, since enforcement during emergencies tends to be humorless.