When it was discovered that the classical planet are not stars? The classical planets (Mercury, Venus, the Sun, Mars, Jupiter and Saturn) were considered to be "wandering stars" - and the word "planet" means just that.

Wikipedia says "By the 17th century, the idea of the stars being the same as the Sun was reaching a consensus among astronomers."

Since the planets were considered stars in those times, the question is when did the astronomers realize that they are something else?

The same question in put in another words: When did the scientists first hypothesize that the planets do not emit their own light, like stars, and they just reflect the star from the sun? And when was that proven for the first time?
On p.33 of the "Cambridge Concise History of Astronomy" it states that Hellenistic astronomers interpreted the variation in the brightness of the planets as a sign that they were closer or further away at various points of time. Unfortunately it doesn't have a deeper discussion here.

But on p.45 it discusses Ptolemy's thinking - he thought Mercury was, at its closest point, as close as the Moon and that the fixed stars were at the same distance as Saturn at its furthest point - the latter point suggesting that while the planets were seen as different, they might not have been thought of as being that different beyond the way they wandered.

To back that up further there is, for instance, a copy of an image from the Nuremberg Chronicle of 1493 on p.77 - here the planets are merely shown as wandering stars.