Helmet law is one of those rules that genuinely varies country by country, and sometimes city by city, so check the local road authority or your embassy's driving guidance for the specific place. Broadly, most of Europe has no mandatory helmet law for adult cyclists, though several countries require them for children under a certain age. Australia and New Zealand require helmets for everyone, with on-the-spot fines. Parts of Canada and some US states and cities have age-based rules, typically covering minors.
Where rules exist, enforcement ranges from strict fines to police mostly ignoring it, but a ticket is still possible and insurance claims after an accident can get complicated if you were not wearing one where required.
Practical advice from someone who has cycled in a lot of places: wear one regardless of the law, especially in unfamiliar traffic. Rental shops and bike-share schemes often offer helmets cheaply or free, and drivers behave differently around cyclists in every country, so give yourself the margin.