When I googled for it, some people say it's formal vs colloquial, some others say there is no difference between the two. Some say Kunststoff is more general. That made me confused.
In addition, is there any preference between these two?
I don't think that what you found is really contradictory at all. The only thing I believe should be clarified is the distinction "formal" vs. "colloquial." Depending on your understanding of "colloquial," I feel this might perhaps lead somewhat astray. "Kunststoff" is clearly the more technical term of the two. Your chemistry teacher would teach you about different kinds of "Kunststoffe," and an airplane manual would most likely specify the material of a switch as "Kunststoff" rather than "Plastik." However, that doesn't mean "Plastik" wouldn't be used in formal non-technical writing. Highbrow newspapers still regularly refer to the material as "Plastik," as would probably your city administration's leaflets on proper recycling.
At the end of the day, I do think there is a certain difference in meaning, much along the lines of what you've already found out. When people talk about "Plastik," they generally talk about what a layperson would ordinarily understand to be plastic: a plastic grocery bag (Plastiktüte), a plastic toy (Plastikspielzeug), a plastic bottle (Plastikflasche), plastic waste (Plastikmüll/-abfall) - a not overly stable, somewhat cheapish material. However, in a technical sense, "Kunststoff" is a very broad term. For instance, there is a picture in the Wikipedia article on "Kunststoff" showing a BMW with a "carbon-fibre-reinforced plastic outer shell." I think most people would be hesitant to say that the outer shell is made of "Plastik." Likewise, if you talk about plastic as an insulation material, you would probably expect the material to be referred to as "Kunststoff" rather than "Plastik."
Plastik is often used in a derogatory sense. For instance, Plastikspielzeug is cheap and bad toy made of plastic. Plastiktüten or Plastikflaschen are often associated with waste (mountains of litter, recycling, waste avoidance).
In contrast, Kunststoff is neutral in value. For high-quality objects, Kunststoff is used instead of Plastik: e.g. Kunststoffgelenk (mechanic), Kunststoffrahmen (from a bicylce).
If you are unsure, or if you don't want to use it in a derogatory way, use Kunststoff. You can replace Plastik with Kunststoff rather than vice versa.
While these terms are interchangeable in colloquial German, there may be differences in a technical context. Plastik is usually only applied to thermoplastics while Kunststoff can be applied to a wider field of artificial materials like thermosetting polymers or elastomers.
In addition to the issue of technical vs. colloquial use addressed in the other answers, I would like to point out that “Plastik” is a homonym.
Since sculptures can be made out of plastic (the material) you’ll certainly want to distinguish the two when you talk about both in the same context:
Der Künstler hat die Plastik aus Kunststoff gefertigt.
is much more comprehensible than
Der Künstler hat die Plastik aus Plastik gefertigt.
Plastik in the sense of a figure in art is not the question here. We are talking about plastic materials.
The other answers said that Plastik in German means something cheap, but that is only partially true. Let’s try to explain it differently.
The word Kunststoff stands for any artificial material and not only plastic. But nowadays most of those materials are made from raw oil. Such materials are used for many things that have been there before the rise of the chemical industry. But due to the chemical industry we do have new artificial materials that are used as substitutes for older materials. And mostly those new materials are even cheaper in production.
For instance toys have been made from wood or metal. But now we have ‘cheap’ plastic toys. Ropes for climbing have been made of hemp but are now based on artificial fiber - which we call Kunststofffaser in German.
Overall I would say that we use Plastik or Plaste for everything with a smooth surface or for anything in daily life. Bottles, bags and so on. Kunststoff is used in a more complex meaning, like fibers for climbing ropes or as carbon fiber for racing cars.
When we speak of the trash in the oceans and at the beaches, then we say ‘Plastikmüll’. Hence again a negative meaning.
Btw: Plastik in the sense of a 3D figure is ‘die Plastik’ in German, while Plastik for artificial materials is ‘das Plastik’.
I might be overthinking this, but to me this seems to make sense:
"der Kunststoff" literally means "artificial material", artificial in the sense of man-made. So this is a technical description of the material.
"die Plastik", in a general context would be something that is shaped by humans. Like plastic surgery, where the Body is shaped through surgery or plastic arts, like statues that are shaped by humans.
So when "Kunststoff" is used to create fabric like Nylon, it stays "Kunststoff". When "Kunststoff" is directly used to create an shape, like injection molded objects, that shape would be "eine Plastik", and the used Material could be called "das Plastik".
So: "Kunststoff" - technical term that focuses on the origin of the matierial. "Plastic" : colloquial term that focuses on the use of the material.
"Plastik" is more informal and especially common to describe packaging (including grocery and garbage bags, clingfilm etc...). Since most packaging plastics is used as a disposable, cheap material, you also get the association of "Plastik" with cheaply made goods out of such materials.
"Kunststoff" is especially common to describe what is called "engineering plastics" in English - expensive, well specified materials used to make quality goods. Also, it is uncommon to find the word Plastik in a formal or semi-formal product description for goods itself (a piece of equipment would come in a Kunststoffgehäuse, and you will usually get a Kunststoffdübel at the DIY store), whereas "in Plastikverpackung" would be commonly found to describe, again, how the goods are packaged.
Kunststoff means an artificial material, Plastik an object shaped by art or artifice (e.g. by casting its material).
From French plastique or Latin plasticus, from Greek plastikos, from plassein ‘to mould’.
Plastik, I venture, is an adjective turned noun like 'submarine'.