The practice of ringing a bell at the consecration (or striking a small gong-like bell or using some other sort of chimes) is not required, but is certainly widespread. Some places did abandon it in the past half-century, sometimes for ideological reasons: I’ve heard priests speak badly about it — I suppose they associate it with “old fashioned things” that “we don’t do anymore”. Who knows.
Historically, as I have always understood it, the bell was rung for a practical reason: to call to the attention of the people that the consecration had happened. (Thus also it might be rung at other times, such as the beginning of the Sanctus, at the epiclesis, and at the priest’s communion — effectively to signal where in the Mass the priest was.) This was needed either because the church was large and not everyone could see the altar, or simply because it was the practice in the Roman Rite for the larger part of its history that the canon — the Eucharistic Prayer — should be recited in a whisper voice, and so most people could not hear where the priest was at in the prayers.
Nowadays, when we have altars facing the people out on extended “tongues” (platforms off the original sanctuary) in remodeled churches, and everything blasted through a PA system with the prayers being said at full voice, ringing a bell may seem redundant or simply quaint. But many people do appreciate having it. And it is still permitted.
For the Ordinary Form of the Mass, no. 150 of the General Instruction of the Roman Missal simply states, “The minister also rings the small bell at each elevation by the Priest, according to local custom.” The “minister” in this context is an altar server. “According to local custom” in this case may mean “not at all” — if the bell is no longer used in that place — or “three times” or “one long ring” or “one long and two shorts”… or however things have developed over time in that place.
In my experience, one of the more widespread practices is to ring the bell three times at the elevation of the host and then again three times at the elevation of the chalice.
This probably originates from the form that the elevation took in the older, now called Extraordinary, form of the Mass, in which the action of the consecration is a bit more complex. For example, the rubric right after the host is consecrated in the 1962 Missal says:
Quibus verbis prolatis, statim Hostiam consecratam genuflexus adorat: surgit, ostendit populo, reponit super Corporale, et genuflexus iterum adorat…
Having spoken these words [of consecration], he genuflecting adores the Host at once: he arises, shows [it] to the people, replaces it on the Corporal, and genuflecting adores [it] again…
So there are three things that happens immediately after the priest consecrates the host: 1) He genuflects while still holding the host; 2) He elevates the host in the air; 3) Then he places the host on the corporal and genuflects a second time. In the Ordinary Form, step # 1 is eliminated.
Thus, in most places, the bell was rung briefly for each of those three actions. And that is probably where we get the idea that we should ring it three times at the consecration — except, in the Ordinary Form, what this has become is ringing it three times while the host is being elevated in the air, but not while the priest genuflects after.
There is nothing wrong with this, even if it doesn’t have the same logic as it did before. We are free to follow “local custom”, as the GIRM (cited above) says in this regard.
(Aside: I was watching the first Mass celebrated in Notre-Dame de Paris since the great fire [on 6/15] and noticed that their custom there is to ring the bell thrice while the host is being elevated, then a long ring while the celebrant genuflects; see this video starting about 37:06 — https://www.youtube.com/watch?v=1GR_NqXFNdA)
I suppose, following the logic of how things were usually done in the past, since there are only two actions now after the consecration (elevation and a single genuflection), it would make the most sense to ring the bell twice, corresponding to those two actions. But I think that most people would sense that something is not aesthetically pleasing about that. We could of course make up reasons for it — ringing twice in honor of the human and divine natures of Christ or something — but, well, that’s not terribly satisfying.
All of that to say, there is really no right or wrong way to ring the bell at the moment of the consecrations; it comes down to local usage and whatever reasons may be behind that usage (if there are any). Some of it just has to do with an aesthetic sense. The bell is not required; in a certain sense, it’s redundant based on how we celebrate Mass in the Ordinary Form. I suspect it especially helps children to focus — but then again, don’t we all sometimes struggle with a wandering mind, even at that most important moment? Overall, I prefer it, and am glad it is still common in my area.