There are a couple of clues in the New Testament that the writers knew their work was inspired and considered it to be holy Scripture. However, there is nothing definitive that proves New Testament writers knew or believed conclusively they were writing holy Scripture.
Did the authors of the New Testament view their writing as inspired Scripture?
Peter writes: "And count the patience of our Lord as salvation, just as our beloved brother Paul also wrote to you according to the wisdom given him, as he does in all his letters when he speaks in them of these matters. There are some things in them that are hard to understand, which the ignorant and unstable twist to their own destruction, as they do the other Scriptures" (2 Peter 3:15–16). Peter, it appears, viewed Paul's writings as Scripture.
And Paul, writing to Timothy, links known Old Testament Scripture with much more contemporary writings from Luke, giving Luke equal status. Paul writes, "For the Scripture says, 'You shall not muzzle an ox when it treads out the grain,' and, 'The laborer deserves his wages'" (1 Timothy 5:18). Paul first quotes Deuteronomy 25:4, then quotes Luke 10:7.
From these verses, and from the context of the entirety of the writings, plus the care and importance with which the early leaders shared and honored the writings that became the New Testament, we can conclude that the writers very well may have known they were writing Scripture, but we cannot prove it.
Whether Paul fully realized it or not, we know that both the Old and New Testaments fit the description of 2 Timothy 3:16–17: "All Scripture is breathed out by God and profitable for teaching, for reproof, for correction, and for training in righteousness, that the man of God may be complete, equipped for every good work."
Is the Bible really the Word of God?
Who wrote the Bible?
What is the meaning of God-breathed in reference to the Bible?
How is the Bible inspired? What does it mean for the Bible to be inspired?
Why should I believe the Bible?
Truth about the Bible