I recently learned of the upper mordent. (first ornament in this image from Wikipedia)
When encountering this symbol, how do you determine whether it is an upper mordent or a trill?
It is a question of period and context, as there was not really a standard way of notating ornaments for a long time and even what existed changed over time. In Bach’s notation for example the upper mordent (in german we call it "prall trill") did not exist, and both the short and the long squiggle were used for a trillo (also in fact I do not know of any ornament table that includes the upper mordent). In later music (classical, romantic) the short squiggle became pretty exclusively the upper mordent (in that times people the upper mordent seemed to be quite popular).
So with sufficiently recent music you are quite safe in taking the short squiggle as upper mordent. For baroque era the safest bet would be to get an ornament table from the composer or a composer from a similar time and area as reference.
If you need a nice collection of ornament tables and specifications in baroque keyboard music have a look at this article: https://publish.iupress.indiana.edu/read/jean-henry-d-anglebert-and-the-seventeenth-century-clavecin-school/section/3ab36d99-c045-458e-87a0-568f3e0bbe49
EDIT: Also of course it depends on the edition. Does the edition try to replicate the composers notation? Or does it try to translate it to modern notation? Or is the editor just doing what he wants?