Changing affiliations and conference registration
There are no hard and fast rules here, and the conference organizers almost certainly do not care.

For most circumstances, the only thing that matters is this: which one do you want people to think of you as being from at the conference?

Most of the time, this will be your new institution.  If you know you're going to be there when you register, why not just give that affiliation?
Otherwise, you may end up doing what I've often seen people with recent changes do, taking a pen and modifying their affiliation on the spot.