Kouichi asked this same question from Chibiki. Chibiki said to consider it as a cellphone going out of range. The curse doesn't affect a person if the person goes out of city.
That's why Kouichi was still unaffected with that curse when he was living in Tokyo. It was mentioned that curse was tied to students of class 3 along with their siblings and grandparents "if they are living in Yomiyama".
From birth, Kouichi was tied to that curse because his mother and aunt studied in class 3 and so the curse was linked to Kouichi also, but as he was living in Tokyo, he remained unaffected.