Contextual setting for the Second Letter to Timothy: There are many theories and proposals, but I submit that Paul was writing to the young overseer Timothy in this letter. The apostle potentially composed this missive between 62-64 CE while imprisoned in Rome for the second time: he speaks of death being imminent to which 2 Timothy 4:6-8 testifies. Timothy, a spiritual child to Paul, an overseer, and co-worker with the apostle evidently was in Ephesus when the letter was written: it is possible that he faced spiritual opponents, but it's less than certain who these Ephesian heretics were.
Greek (SBLGNT): κήρυξον τὸν λόγον, ἐπίστηθι εὐκαίρως ἀκαίρως, ἔλεγξον, ἐπιτίμησον, παρακάλεσον, ἐν πάσῃ μακροθυμίᾳ καὶ διδαχῇ.
NRSV: "proclaim the message; be persistent whether the time is favorable or unfavorable; convince, rebuke, and encourage, with the utmost patience in teaching."
Grammatical Parsing of 2 Timothy 4:2: κήρυξον τὸν λόγον: κήρυξον is the first aorist active imperative of κηρύσσω (see Robertson's WP).
τὸν λόγον is the direct object of the verb, so the phrase (determiner + noun) fittingly appears in the accusative case: the construction could be rendered "preach the message" or "preach the word." Mounce thinks the article is anaphoric and links τὸν λόγον with πᾶσα γραφὴ θεόπνευστος in 2 Timothy 3:16-17.
ἐπίστηθι εὐκαίρως ἀκαίρως: ἐπίστηθι is aorist active imperative 2nd singular of ἐφίστημι.
Here we see the occurrence of two adverbs that both pun another Greek word (καιρός), and they combine to provide a rhetorical contrast ("favorable season, unfavorable season." NET Bible has "in season, out of season" in its footnote). Both adverbs modify ἐπίστηθι.
For ἔλεγξον, compare Matthew 18:15; Sirach 19:13-15. Louw-Nida has "rebuke" for this word: see semantic domain 33.417.
Another issue is whether εὐκαίρως ἀκαίρως are objective (pertaining to those heard by Timothy) or subjective (pertaining to Timothy himself).
ἔλεγξον, ἐπιτίμησον, παρακάλεσον: all three aorist verbs comprise a fivefold cluster with other imperatival verbs in 2 Timothy 4:2a-e. See Paul and the Ancient Letter Form, page 248, edited by Stanley Porter.
ἔλεγξον is the aorist active imperative 2nd singular of ἐλέγχω.
ἐπιτίμησον is the aorist active imperative 2nd singular of ἐπιτιμάω.
παρακάλεσον is the aorist active imperative 2nd singular of παρακαλέω.
The string of 2nd person singular aoristic forms indicates that Timothy is the addressee.
ἐν πάσῃ μακροθυμίᾳ καὶ διδαχῇ: ἐν πάσῃ is a prepositional phrase that modifies μακροθυμίᾳ καὶ διδαχῇ. The prepositional phrase describes the instrumentality or means by which something is done (i.e., "with all patience and teaching" or "with complete patience and teaching" as Bill Mounce renders the construction. Compare NWT 2013).
Expositor's Greek Testament: "ἐν πάσῃ μακροθυμίᾳ καὶ διδαχῇ: This qualifies each of the three preceding imperatives; and πάσῃ belongs to διδαχῇ as well as to μακρ., with the utmost patience and the most painstaking instruction."
Compare Titus 1:9. See the analysis in Bengel's Gnomon: he perceives significance in κήρυξον τὸν λόγον, ἐπίστηθι εὐκαίρως ἀκαίρως, ἔλεγξον, ἐπιτίμησον, παρακάλεσον being asyndetic. Notice the examples that Bengel also musters to elucidate the functionality of the adverbs εὐκαίρως ἀκαίρως.
From Rogers and Rogers-κήρυξον aor. imp. act. κηρύσσω to proclaim as a herald, to preach (s. 1 Tim. 2:7). Not “begin to preach,” but “preach as your first priority” (GGBB, 721). ἐπίστηθι aor. imp. pass. ἐφίστημι to take one’s stand, to stand by, to be at hand. The word was also used in a military sense—to stay at one’s post—but here it means to be at one’s task and indicates that the Christian minister must always be on duty (Kelly; Guthrie).
Abbott-Smith: ἀκαίρως, adv. (< ἄκαιρος, unseasonable), [in LXX: Si 35 (32):4 *;] out of season, unseasonably: opp. to εὐκαίρως (q.v.), II Ti 4:2 (cf. Cremer, 740; MM, VGT, s.v.). †
Linda Belleville (Cornerstone Biblical Commentary): Parakaleō [TG3870, ZG4151] is commonly used, with several possible meanings. The most likely meanings here are “exhort” (urge strongly to do something) or “comfort” (instill with courage or cheer). The context favors the former.
Donald Guthrie (The Pastoral Epistles): All these imperatives must be effected with great patience and careful instruction. The first denotes the manner and the second denotes the method which Timothy must adopt; makrothymia here translated ‘patience’ is a favourite Pauline expression, and is generally used of God’s forbearance. In Colossians 1:11 it is used, as here, of the Christian’s patience in trying circumstances.