Here is the answers for your questions:
-
what is “contagem do tempo”? Please see the screenshot of the “contagem do tempo” in this post. HOW-TO: GV Automatic Online Renewal Procedure (Jan 2023→) - #380 by live2learn
-
how to get the contagem do tempo? Please see this thread. You can turn on google translate to watch the whole clip of how to get this document
CertidĂŁo de Contagem do Tempo - How to get - #3 by live2learn -
is this only required when applying for citizenship? No it is not required. If you can provide all old resident cards which add up to the total times of 5 years, it is also acceptable.
Basically you have two options. Either all cards (adding up to 5 years of residents) or contagem do tempo (certifying that you have been resident in PT for 5 years).