Traditional grammar calls this a “demonstrative adjective” when it is used this way. Many words of this sort—for instance, this, that, some, all, most, which and numbers like one, three, ten—have this sort of dual use.
A more modern grammatical treatment classifies these words as “determinatives”, in the same category as the articles a/an and the. This, specifically, is classified as a demonstrative determiner. Their “core” syntactical use of determinatives is as “determiners” introducing a noun phrase to help determine what entity you are referring to. Most (but not all) determinatives can also “stand for” an entire noun phrase, if that has already been defined in the discourse. In this case this treatment speaks of a “fused-head determiner” rather than a “pronoun”: the noun “fused into” the determiner.
As DamkerngT points out, several personal pronouns have distinct forms for uses of the possessive as a fused-head determiner: my becomes mine, your→yours, her→hers, our→ours, their→theirs.