When. Over children, most often — it is transmitted as words said over the Prophet's grandsons — and it remains the supplication parents reach for at bedtime or when a child has been much admired. Adults say it for themselves too. There is no fixed hour attached to it.
The words. Kalimat Allah at-tammah, the perfect words of Allah, with tammah meaning complete, with no gap. Hammah is a crawling venomous creature, the sort found in a house rather than hunted in the open. And 'aynin lammah: lamma is from a root meaning to gather up and to touch or afflict, so the phrase is not simply "an evil eye" but a look that collects harm and brings it near. The description is of what the glance does, not of the person glancing — which is why the supplication asks for refuge rather than naming an enemy.
Three kinds of harm, in order. An unseen intelligence, a seen creature without one, and a human look. The list moves from what cannot be watched for, through what can be, to what arrives from someone standing in front of you and probably meaning no harm at all. Refuge is sought from all three in one sentence because the sentence is not about identifying the source.
What it does not license. Nothing here supports suspicion of neighbours or reading misfortune as an accusation. The words point away from the human being entirely and towards Allah's speech. Alongside it, the ordinary courtesy of saying masha Allah and barakallah when admiring something removes half the occasion.
Common confusion. The traveller's supplication on stopping somewhere uses the plural at-tammat and ends "from the evil of what He created." That is a different, shorter one.