Vin is assigned generally just before production. Production and VIN assignment can take a week. Of course, VINs have been reassigned to another customer after production. This is usually toward the end of a quarter when Tesla wants the car delivered before the end of the quarter. Doesn't happen often.
My VIN was assigned on Jan 27 with a delivery date of Jan 27 - Jan 31. I got my VIN the same day the car arrived at my delivery center. The build date was Jan 6. Why I wasn't notified sooner, I don't know. After having the car for the last 2 weeks, I don't care. It's awesome! All the edd nonsense evaporates on the drive home from the delivery center.