Here is a transcription of Bach's own Table of Ornaments from the Klavierbüchlein vor Wilhelm Friedemann Bach. A PDF of the Klavierbüchlein ms is available on IMSLP here. (This Prelude is in the Klavierbüchlein, but completely devoid of ornamentation.) You may find the discussion here useful (a condensation of the subject as presented in Willard Palmer's edition).
Your first example has two parts: an appoggiatura and a trill.
An appoggiatura is not a grace note. In Baroque music, it is shorthand for a nonharmonic tone resolving by step into a tone of the harmony. All the commentators of the time (C. P. E. Bach, Marpurg, etc.) agree that an appoggiatura of a regular note value is played on the beat and takes a duration of half the written value. Most agree that an appoggiatura played against a dotted note takes 2/3 of the written duration, although there is a certain freedom allowable. In this particular case, anything from a crochet to a dotted minim should work pretty well.
There is no such thing as a Baroque upper mordent, however: that's a later (19th century) ornament. C. P. E. Bach was vehement that trills always started on the upper auxiliary, and J.S. Bach's table certainly shows that kind of trill for this symbol. In a case like this, where the upper auxiliary repeats the appoggiatura, starting on the auxiliary would help keep the trill from sounding like a kind of Nachschlag of the appoggiatura. Note that the number of alternations in the trill is variable.
Having said that, I have heard an effective rendition on harpsichord that used a crochet-length appoggiatura and started the trill on the main note, so you have some leeway in ornamenting the Prelude. The Prelude does exist in a number of manuscripts and underwent some changes along the way. Prelude 4 in the fair autograph of WTC I (P415, which Bach signed off with "SDG", Soli Deo gloria, at the end) is like the version in the Klavierbüchlein in being devoid of ornamentation. You can see it here at the Staatsbibliothek-Berlin (bottom half of the page). Ornamentation would have been added according to the conventions of the time.
My understanding is that the written ornamentation was added at a later stage (not necessarily by Bach, but possibly definitive copies by students). The WTC went through a number of stages of revision after the autograph. The question can be vexed: here is some discussion of it, and the Preface to the Henle Urtext edition gives an idea of the development. I haven't got the Henle edition, so I can't say what they would show as definitive (and what in small notes and symbols) as a result of Heinemann's research. I'm not a Bach scholar, so I don't know where to track down all the sources, nor do I know their relative merits. For this, you can pick up your own Urtext or critical edition (usually a good idea), and work out for yourself what ornamentation is correct and/or effective.
So... The takeaway here is that the appoggiatura is an emphasised non-harmonic tone played on the beat with a fairly substantial duration, and that the symbol over the main note is for a trill, not an upper mordent - Baroque mordents only used the lower auxiliary. Last, these ornaments were added in later copies of the WTC I manuscript that the editors of the Bach-Gesellschaft (whose edition you've got) considered authoritative.
In your second example, yes, the mordents would apply to the alto voice. If both voices were affected, there would be mordent symbols both above and below the stave. You would thus play the first instance as something like demisemiquavers A♯-G♯-dotted quaver A♯ (the rhythm in Bach's table) under the held C♯.