That's a good question. Since the Constitution doesn't define what residency means, I would think that it goes by state statutes. I believe many states use the "183-Day" rule to determine residency.
Dick Cheney changed his residence on July 21, 2000.
SCOTUS considers 30 days as ample to establish residency for voting.