"Gifted" is of course a spectrum. You'd know if you were smarter than the average bear if you got put up a class, put into "the smart kids class", or got selected for various leadership programs etc.
Of course not everywhere would have such programs, but there will likely be other tell-tale signs as well.
Seems like it's since been reworked, but before 2014 elementary kids in the US were tested and potentially placed in the GATE Program[1] based on their results.
Presumably you get told you're gifted by the education system following some assessment.
Personally, I'd never even heard of the term "gifted" until I left home for university, it wasn't a thing that existed in the rural location where I grew up.
When I was growing up, it meant you scored 130 or higher on an IQ test administered by a professional psychologist. For me, I had this administered in 3rd grade. I assume some teacher suggested I get tested.
The most quantitative measure is IQ. People like to criticize it but in psychology it is the most empirically verified number that correlates with so many things.