General speaking, a foreigner who purchases a condominium unit in Thailand will not automatically receive a long term visa. If he wishes to get it, he must apply for a work permit or follow any other requirements necessary under Thai law.
Nevertheless, there are some condominium projects that collaborate with the Elite Thailand Program, which allows foreigners who purchase a condominium unit in the particular projects to receive a long term visa.
The foreigners who are interested in a long term visa should ascertain the facts from the relevant brochures as well as from the developers of the projects first.