Dante's Divina Commedia, completed in 1321, ends in the verse:
the Love that moves the sun and the other stars.
suggesting that at the time it was already known that the Sun is a star.
With some research, I found that Stanford Solar Center's page (Who discovered that the Sun is a star?) reports that Anaxagoras (450 B.C.) and Aristarchus of Samo (310-230 B.C.) suggested that the Sun was a star in ancient times, but were later threatened because of this. A few centuries later, Ptolemaeus's geocentric model (140), which does not consider the Sun and the stars to be the same type of body, became the official one for centuries to follow. The Stanford page then reports Giordano Bruno (1548-1600) as the next scientist to suggest that the Sun is a star, until Galileo hypothesized that the stars must be very far away (1610).
So how did Dante know that the Sun is a star, and how common was that knowledge during his time?
I don't know about Dante's own sense of astronomy, but it is just worth knowing that for Ptolemy, there is a difference between "stars" and "fixed stars." In the Almagest, Ptolemy calls all heavenly bodies "stars." He distinguishes between the "fixed stars" and the "planets" (in which the Sun is included), but "stars" can mean either. So you can find statements like this throughout it: "We can see, again, that the sun, moon and other stars do not rise and set simultaneously for everyone on earth, but do so earlier for those more towards the east, later for those towards the west," without any apparent contradiction. Modern translations sometimes obscure this because they translate "star" as "planet" when in context that is clearly what is meant. It seems possible that Dante used "stars" in this way as well. When Ptolemy refers exclusively to what we consider stars, he speaks of the "fixed stars" (though even these he occasionally calls the "so-called fixed stars" because of their precession).