In the two examples you cited, Papier and Kaffee are uncountable nouns, so when there are quantitative modifiers, they remain singular; If it is a countable noun, when the preceding quantity >; 1, it becomes plural;
The singular and plural changes of nouns that constitute the concept of quantifiers follow the following rules:
A) When masculine or neuter nouns form quantifiers, there will be no plural changes:
A cup of coffee, a cup of coffee
B) When the feminine nouns form quantifiers, there will be plural changes:
A piece of black paper, zwei Bl? Tter paper
A cup of coffee, a cup of coffee
I wish you a happy study!