The word γραφή ("scripture, writing") is used to refer to a variety of written documents - I'd like to understand the similarity or difference in meaning across 4 passages.
It can refer to:
The Tanakh
And he began to say unto them, This day is this scripture fulfilled in your ears. (Luke 4:21)
He has just quoted from the Tanakh (specifically Isaiah 61:1-2), and refers to it as scripture.
The Gospel of Luke
For the scripture saith, Thou shalt not muzzle the ox that treadeth out the corn. And, The labourer is worthy of his reward. (1 Timothy 5:18)
The first portion of this passage references the Old Testament as well (Deut. 25:4), but the last clause quotes Luke 10:7; the most straightforward reading of this passage suggests that both clauses are referred to as scripture (see also this post).
Other writings?
And a certain Jew named Apollos, born at Alexandria, an eloquent man, and mighty in the scriptures, came to Ephesus. (Acts 18:24)
Many read "scripture" here as a reference to the Jewish scriptures--and I agree that's an entirely possible interpretation. That would also make vs 25 a little redundant though, so perhaps it's possible that vs. 24 is simply telling us Apollos is well-read, or, in addition to being a great speaker, he is also a gifted writer.
And from 2 Peter 3:
15 And account that the longsuffering of our Lord is salvation; even as our beloved brother Paul also according to the wisdom given unto him hath written unto you;
16 As also in all his epistles, speaking in them of these things; in which are some things hard to be understood, which they that are unlearned and unstable wrest, as they do also the other scriptures, unto their own destruction.
Whether Peter is referring to Paul's epistles as good writings in a general sense or as holy writ on par with the Tanakh is a subject that has been much debated.
Non-biblical
To be sure, in other places the word γραφή certainly had a broader meaning in contemporary Greek (e.g. see here)
Question
Do forms of the word γραφή mean the same thing in each of these 4 Biblical passages?
What hermeneutical principles should be applied to understand when γραφή refers only to the Tanakh vs more recent holy writ vs "writings" in general?
I read this question and am asking something a little bit different. The related question asks about a single meaning/usage of γραφή across the entirety of the NT. I'm open to multiple usages and I'd like to understand whether the word carries various meanings or just one, in the 4 passages I've cited.