To the French ear, when is best to use 'habiter' and when 'vivre'?

Habiter to me sounds like ‘reside’ (but for how long?), as opposed to ‘live’(vivre) or spend one’s life or a long while staying in a place but I’m never quite sure when to use either.

I’m an Anglo Canadian who has taken a zillion French lessons and worked with French speakers a lot (using a lot of English and my clumsy, awkward French). So, somewhere along the way I learned to say that “j’habite a Montreal…” for “I live in Montreal”. I suspect that to say that I vivre somewhere simply means that I am literally alive in that place.

Having said that, I recommend hearing what a French speaker says.

That’s my impression too. Vivre is existential; habiter is, as you say, residential.

When someone asked Talleyrand (the great survivor of the French Revolution and its successor regimes) what he’d done in the revolution, he simply said “J’ai vécu”

You can use both but “vivre” is generally restricted to long periods of time.
“Je vis à Lyon” is not usual, but “j’habite à Lyon” is. the meaning is that I currently am living in the city of Lyon.
"j’ai vécu à Lyon pendant 10 ans " or “J’ai habité à Lyon pendant 10 ans” have the same meaning and can be used: “I lived in Lyon for 10 years”

Thank you FrenchDunadan. That helps a lot.