Not on David's Death of Socrates (the painting referred to in the question), but on Rafael's fresco the School of Athens (Scuola di Atene), an interpretation of Plato's and Aristotle's right hand gestures has been proposed.
In their left hands, Plato carries the book of Timaeus and Aristotle Ethics. According to that interpretation, Plato is pointing upwards signifying his theory of ante re forms (i.e., in heavens) and Aristotle's hand, raised (objecting), palm facing down, signifying his theory of in re forms (i.e., on Earth).
In Plato's Phaedo which describes Socrates' last hours after he is sentenced to die by drinking a poison called hemlock (the cup in the painting), Socrates argues for the immortality of the soul and says that death frees the soul from the corrupting influences of the body, and says "I not only do not grieve, but I have great hopes that there is something in store for the dead... something better for the good than for the wicked". So the painting is probably showing a gesture related to his discussion of some sort of "higher" realm of experience where the soul might go after death, and since the painter was from a Christian culture it might be natural to have him pointing up because of the associations with heaven.