From First and Second Timothy, Titus by George T. Montague, commenting on 2 Timothy 3:14-4:2
Back to Timothy, continuing the exhortation of 3:10: he is not to be shaken by any novel teaching but to hold firm to the faith and teaching he once learned. The †aorist tense of the verbs learned and believed refers to a past moment rather than a progressive growth, hence, the moment of his public profession of faith.
Though Timothy’s faith, like that of every Christian, was a grace given by God, there were human instruments of the learning. Although Paul certainly formed Timothy more deeply in the faith, filling out his instruction (1 Thess 3:10), it was not from the apostle that he first learned the faith. Already from infancy he has known the sacred scriptures (literally “the holy letters”).
Instead of using the normal term graphē for the Scripture, Paul here uses grammata, meaning literally “letters of the alphabet.” Ceslas Spicq notes that this is a beautiful way of speaking of how a child learns to read—first learning the letters. Of course, by extension, the word means the sacred Scriptures (John 5:47). These were the Jewish Scriptures, which Timothy’s mother may have taught him before she became a Christian. These Scriptures become sources of saving wisdom when one accepts them as fulfilled in Christ Jesus.