how does one know how many violins are intended?
One way is to look at the churches where the piece was performed and at the surviving performance materials. The most obvious conclusion is that Mozart expected the string sections to be of a size appropriate to the venue: larger for larger churches, larger for more festive occasions, and (of course) able to fit in the allocated space, for example in the organ loft.
I did not find any evidence of the venues in which Mozart's Salzburg masses were performed. Obviously they would have been performed in the cathedral, but they were probably also performed in other churches in the city, of which some are considerably smaller. I imagine there is research along these lines; I just don't see it in my usual online resources, and I don't have ready access to it in printed form.
Looking at the mass in question, we can see that there is a set of parts held by the Salzburg archdiocese. Twenty-nine of the 40 parts date from Mozart's lifetime, including three parts for each voice of the choir and two parts for each violin section (and trombones, presumably doubling the three lower choral parts). This suggests that there were as many as 8 violinists for at least one performance during his life, though that doesn't of course guarantee that he was involved in such a performance.
There is also a 1776 set of parts held by the diocesan archive of Bressanone, the neighboring diocese to the southwest. This set comprises 20 parts, of which four were copied by a different person; these four include second copies of each violin part (and the only copies of each oboe part).
It's also worth noting that none of this implies that Mozart wouldn't have expected the mass to be performed in a smaller church with smaller forces.
In general, the flexible approach to the forces employed shows that the idea that there is a single canonical version of a piece is flawed. Many composers revise their work for subsequent performances. If Mozart might add winds or trombones to an existing mass, it's surely to be expected that he might omit them in certain circumstances. In the context of such flexibility, we shouldn't expect that Mozart had any number of strings in mind other than "an ensemble of a size appropriate to the venue and the occasion."
It occurred to me that there might be more information in the German Wikipedia article on the mass than in the English, and indeed that is the case. The latter says
The first performance was in Salzburg in November 1776.
The former says
Die Messe wurde am 17. November 1776 im Salzburger Dom uraufgeführt, Anlass war die Weihe des Salzburger Domherren Ignaz von Spaur (1729–1779) durch Erzbischof Hieronymus zum Bischof. Spaur war seit 1755 Domherr zu Salzburg und seit 1763 Kanonikus in Brixen gewesen. 1776 trat er das Amt des Bistumskoadjutors von Brixen ... an.
My translation; I've chosen not to translate Domherr because I can't find a dictionary that includes it:
The mass was first performed on November 17th, 1776, in the Salzburg cathedral for the consecration of Domherr Ignaz von Spaur (1729-1779) as bishop by Archbishop Hieronymus. Spaur had been Domherr of Salzburg since 1755 and since 1763 Canon in Bressanone. In 1776 he assumed the office of coadjutor bishop in Bressanone....
This tells us that the mass was indeed written for a festive performance in the cathedral, suggesting a larger complement of violins. Some questions that remain unanswered include
could more than two players perform from each part? (Perhaps more to the point, was the cost of producing a part so high that players might actually be doing that?)
could there have been extra (low-quality) parts that players might have used for practice or even in performance that were not kept in the archdiocesan library?
are there financial records shedding light on the composition of the performing ensemble?
where in the cathedral were the performers stationed? How much room is there?
The German article also notes that Leopold Mozart mentioned this mass in a letter to his wife and son:
Der Erzbischof von Ollmütz ist den 17t geweiht worden. hättest Du in Manheim nicht so viel für andere Leute zu thun gehabt, so hättest Du Deine Messe aus machen und mir schicken können. ... ich machte des Wolfg: Meße mit dem Orgl Solo. Das kyrie aber aus der Spaur Messe; ließ sie schreiben, und bekamm die 6 Duccatten richtig.
The archbishop of Ollmütz was consecrated on the 17th. If you hadn't had so much to do for others in Mannheim you could have written out your mass and sent it to me. ... I did the Wolfg: mass with the organ solo, but the Kyrie from the Spaur mass; had it written out, and got the 6 ducats.
It doesn't tell us anything about the number of violins, but it does support the conclusion that these pieces were subject to adaptation as circumstances dictated.