The Greek texts of the relevant verses according to the NA28:
Matthew 6:2
Βʹ Ὅταν οὖν ποιῇς ἐλεημοσύνην, μὴ σαλπίσῃς ἔμπροσθέν σου, ὥσπερ οἱ ὑποκριταὶ ποιοῦσιν ἐν ταῖς συναγωγαῖς καὶ ἐν ταῖς ῥύμαις, ὅπως δοξασθῶσιν ὑπὸ τῶν ἀνθρώπων· ἀμὴν λέγω ὑμῖν, ἀπέχουσιν τὸν μισθὸν αὐτῶν. NA28, ©2012
Matthew 6:5
Eʹ Καὶ ὅταν προσεύχησθε, οὐκ ἔσεσθε ὡς οἱ ὑποκριταί, ὅτι φιλοῦσιν ἐν ταῖς συναγωγαῖς καὶ ἐν ταῖς γωνίαις τῶν πλατειῶν ἑστῶτες προσεύχεσθαι, ὅπως φανῶσιν τοῖς ἀνθρώποις· ἀμὴν λέγω ὑμῖν, ἀπέχουσιν τὸν μισθὸν αὐτῶν. NA28, ©2012
Matthew 6:16
IϚʹ Ὅταν δὲ νηστεύητε, μὴ γίνεσθε ὡς οἱ ὑποκριταὶ σκυθρωποί, ἀφανίζουσιν γὰρ τὰ πρόσωπα αὐτῶν ὅπως φανῶσιν τοῖς ἀνθρώποις νηστεύοντες· ἀμὴν λέγω ὑμῖν, ἀπέχουσιν τὸν μισθὸν αὐτῶν. NA28, ©2012
The word in question is ὅταν, translated by most English versions as “when” or “whenever” in these three verses. Although ὅταν is indeed more often translated into English as “when” by the King James Version (for example),1 it is not the typical relative pronoun “when”: ὅτε. Rather, it is a combination of ὅτε and ἄν.
With respect to ὅτε, it is used in conjunction with a verb conjugated in the present tense, indicative mood “of something certain and customary.”2
On the other hand, regarding ὅταν, Wilke (translated by Thayer) wrote,3
ὅταν, a particle of time, comp. of ὅτε and ἄν, at the time that, whenever, (Germ. dann wann; wann irgend); used of things which one assumes will really occur, but the time of whose occurrence he does not definitely fix (in prof. auth. often also of things which one assumes can occur, but whether they really will or not he does not know; hence like our in case that, as in Plato, Prot. p. 360 b.; Phaedr. p. 256 e.; Phaedo p. 68 d.); [cf. W. § 42, 5; B. § 139, 33];
Kühner (translated by Jelf) wrote,4
§. 840. The indic[ative] is used when what is said is to be represented as a fact—past, present, or future.
§. 841. 1. The conjunctive [i.e., subjunctive] is used after temporal relative adverbs or conjunctions, when what is said is not considered as an actual fact, but only as something imagined or thought of, and the verb of the principal clause is in a principal tense. The conjunctions most frequently take the particle ἄν,—ὅταν...—which ἄν points to certain circumstances on which the time of the conjunction, or action of the conjunctive depends.
§. 841. 2. With those relative conjunctions which express a point of time, such as those from ὅταν to ἐπειδάν, the ἄν belongs to the time of the conjunction, and consequently to the time of the action, and gives an indefinite and uncertain sense to the conjunction, by showing that it depends on certain conditions—that it is uncertain and future: thus will ὅτε would express when, ὅταν &c. signify whensoever.
Winer (translated by Moulton) wrote,5
The particles of time are followed by the conjunctive ἄν (Matth. 521), when the reference is to an (objectively possible) action, a case which may or will occur, but in regard to which there is no certainty when (how often) it will occur...
a. ὅταν (i.e., ὅτʼ ἄν): Mt. 15:2, νίπτονται τὰς χεῖρας, ὅταν ἄρτον ἐσθίωσιν, when (i.e., as often as) they eat, Jo. 8:44, 1 C. 3:4, L. 11:36; 17:10, ὅταν ποιήσητε πάντα, λέγετε, when ye shall have done, Mt. 21:40, ὅταν ἔλθῃ ὁ κύριος.… τί ποιήσει, quando venerit. So usually with the aorist conjunctive for the Latin futurum exactum, Mk. 8:38, Jo. 4:25, 16:13, Rom. 11:27, A. 23:35, 1 C. 15:27, 16:3, 1 Jo. 2:28; and also H. 1:6 (as was pointed out by Bohme and Wahl). The present conjunctive, on the other hand, usually indicates an action of frequent recurrence, not limited to any particular time (Matth. 521), or else represents something which in itself is future simply as an event (1 C. 15:24, where it stands by the side of the aorist conjunctive).
In summary, the idea is that almsgiving, fasting, prayer, etc. were all recognized as things that would happen, else why would Jesus care to remark concerning them? That being said, ὅταν is not “when”—looking at a specific frequency of performance—but “whenever,” as in, “If it so be that you fast, then...” To note, however, these works were all recognized as fruit of the Holy Spirit. There was really no argument concerning whether those such things would be done.
Footnotes
1 KJV, ©1769: “when”: ὅταν, 115x; ὅτε, 98x
2 Wilke, p. 458, ὅτε, 1.
3 id., ὅταν
4 Kühner, p. 514, §841.1–2
5 Winer, p. 387, §42, 5., a.
References
Kühner, Raphael. A Grammar of the Greek Language, Chiefly from the German of Raphael Kühner. Trans. Jelf, William Edward. 2nd ed. Vol. 2. Oxford: Wright, 1851.
Wilke, Christian Gottlob. A Greek-English Lexicon of the New Testament: Being Grimm Wilke’s Clavis Novi Testamenti. Trans. Thayer, Joseph Henry. Ed. Grimm, Carl Ludwig Wilibald. Rev. ed. New York: American Book, 1889.
Winer, George Benedikt. A Treatise on the Grammar of New Testament Greek. 3rd ed. Trans. Moulton, William Fiddian. Edinburgh: Clark, 1882.