The idea of Purgatory as a physical place (like heaven and hell) became Roman Catholic teaching in the late 11th century.
The idea that Purgatory is a physical place is not Catholic doctrine. On the other hand, the idea of a cleansing (spiritual) fire goes back to the early Church:
OrigenIf a man departs this life with lighter faults, he is condemned to fire which burns away the lighter materials, and prepares the soul for the kingdom of God, where nothing defiled may enter. For if on the foundation of Christ you have built not only gold and silver and precious stones (I Cor., 3); but also wood and hay and stubble, what do you expect when the soul shall be separated from the body? Would you enter into heaven with your wood and hay and stubble and thus defile the kingdom of God; or on account of these hindrances would you remain without and receive no reward for your gold and silver and precious stones? Neither is this just. It remains then that you be committed to the fire which will burn the light materials; for our God to those who can comprehend heavenly things is called a cleansing fire. But this fire consumes not the creature, but what the creature has himself built, wood, and hay and stubble. It is manifest that the fire destroys the wood of our transgressions and then returns to us the reward of our great works. (Patres Groeci. XIII, col. 445, 448 [A.D. 185-232]).
Tertullian
That allegory of the Lord [Matt. 5:25-26] . . . is extremely clear and simple in its meaning . . . [beware lest as] a transgressor of your agreement, before God the judge . . . and lest this judge deliver you over to the angel who is to execute the sentence, and he commit you to the prison of hell, out of which there will be no dismissal until the smallest even of your delinquencies be paid off in the period before the resurrection. What can be a more fitting sense than this? What a truer interpretation? (The Soul 35 [A.D. 210]).
Cyprian
It is one thing to stand for pardon, another thing to attain to glory; it is one thing, when cast into prison, not to go out thence until one has paid the uttermost farthing; another thing at once to receive the wages of faith and courage. It is one thing, tortured by long suffering for sins, to be cleansed and long purged by fire; another to have purged all sins by suffering. It is one thing, in fine, to be in suspense till the sentence of God at the Day of judgment; another to be at once crowned by the Lord (Letters 51[55]:20 [A.D. 253]).
Et alii.