How long do I have to live in a state for VA to consider the state my residence?

In order for a state or other jurisdiction to be considered the place where you reside, you must live in the place continuously for a reasonable period of time, or have moved there with the intent to remain for, at least, a reasonable period of time. This would not include a visit to or a temporary stay in a location. On the other hand, a temporary absence from a place where you ordinarily live would not defeat the finding that you reside in that place.