I am not a lawyer or in law enforcement in any jurisdiction in the United States, but I presume it becomes illegal once you use the lab equipment and materials to cook up a controlled substance. Possibly a provable intent to do so is sufficient.
In some places, notably Texas. even ordering the glassware is potentially a crime.
Most normal places, it comes down to intent, as **DrFidelius **said. (I also am not a lawyer. I do own some lab glass, it’s fun.)
There are a couple of precursor chemicals that possession of can be regarded as “intent.” Sort of like burglary tools - you don’t have to actually steal anything to get busted for planning to.