It is always better to have your auto insurance for any car you are buying set up before you take ownership of it. If you don't have an insurance policy then you definitely would not have automatic coverage. If you were buying the car with a loan it is possible that the lienholder would require you to have insurance before you leave the dealership.
If you have a car and insurance then you may be afforded insurance. Each state has different laws and each insurance company has different rules.
Generally insurance companies will transfer coverage of an existing car (or vehicle that you traded in) to the "new" one for up anywhere from a few day up to 30 days. The amount of time depends on your insurance company's rules and state laws.
A common mistake is when someone has liability coverage only on a vehicle and then they purchase a car that needs physical dammage (because of a loan or lease) and they are not coverd. Be forewarned that the coverage transferred is typically limited to the amount of coverage on the old vehicle.
If you never notify the company or not within the days allows by law or rules (sometimes 5, 14 and even 31 days) then the new car would not be covered.