The Law of Karma can be said to be the cornerstone of Hindu philosophies. Where in Hindu scriptures do we find the first mention of the Law of Karma? Does it have mention in Vedas?
The law of Karma is not explictly mentioned in the Samhitas of the Vedas (the part of the Vedas heard from the gods). But there's still implicit mention of it even in the Samhitas, for instance in this hymn from the Tenth Mandala of the Rig Veda, which describes the benefits of generously and liberally giving Dakshina (gifts) to the Brahmanas who have performed a Yagna (ritual) for you (Dakshina is translated with the archaic English word Guerdon meaning gift or reward):
High up in heaven abide the Guerdon-givers: they who give steeds dwell with the Sun for ever. They who give gold are blest with life eternal. They who give robes prolong their lives, O Soma.... He who brings Guerdon comes as first invited: chief of the hamlet comes the Guerdon-bearer.... Guerdon bestows the horse, bestows the bullock, Guerdon bestows, moreover, gold that glisters. Guerdon gives food which is our life and spirit. He who is wise takes Guerdon for his armour.
The liberal die not, never are they ruined: the liberal suffer neither harm nor trouble. The light of heaven, the universe about us,—all this doth sacrificial Guerdon give them. First have the liberal gained a fragrant dwelling, and got themselves a bride in fair apparel. The liberal have obtained their draught of liquor, and conquered those who, unprovoked, assailed them. They deck the fleet steed for the bounteous giver: the maid adorns herself and waits to meet him. His home is like a lake with lotus blossoms, like the Gods’ palaces adorned and splendid. Steeds good at draught convey the liberal giver, and lightly rolling moves the car of Guerdon. Assist, ye Gods, the liberal man in battles: the liberal giver conquers foes in combat.
So giving Dakshina to the Brahmanas performing your Yagna can bestow upon you, among other things: being high up in heaven, an eternity with Surya, eternal life, a long life, being invited first, becoming chief of your village, a horse, a bullock, gold, food, a bride, the light of heaven, the Universe (!), a beautiful house, a bride, liquor, a good chariot, and victory in battle. This is a clear case of a good deed leading to benefits in both this life and in the afterlife.
But the oldest explicit mentions of the Law of Karma are from the Brihadaranyaka Upanishad, which is one of the oldest Upanishads because it is actually part of the Shatapatha Brahmana of the Yajur Veda.
Here is what Part 3, Chapter 12, Adhyaya 13 of the Brihadaranyaka Upanishads says (Nikhilananda's translation):
Then [sage Yajnavalkya and his student] went out and deliberated, and what they talked about was karma (work), and what they praised was karma: one becomes good through good karma and evil through evil karma.
Part 4, Chapter 4, Adhyaya 5 contains a similar statement:
According as [the self] acts and according as it behaves, so it becomes: by doing good it becomes good, and by doing evil it becomes evil. It becomes virtuous through virtuous action, and evil through evil action.... As is its desire, so is its resolution; and as is its resolution, so is its deed; and whatever deed it does, that it reaps.
So the earliest enunciation of the doctrine of Karma comes to us from these words of the sage Yajnavalkya, a contemporary of Janaka.