I noticed that the phrase 'one-act play' always uses a hyphen between 'one' and 'act'.
Is there a grammar rule in play here, how does it work?
That link Vikas gave was dead for me, so I'll explain it in short. Whenever an adjective consists of more than one word, and comes before the noun it belongs to, it should get a hyphen. This is done to make it easier for the reader. In your example, without the hyphen, it would be an act play, and just one such play—which doesn't make sense—instead of a play of one act, which is what you mean. While it may not be a problem in this case, it can be in others; and if we are not consistent, we cannot use hyphen-or-no-hyphen as a significant marker in all cases.
Yes, there is a reason for it. With the hyphen, the two words, "one" and "act," become a compound adjective. Without it, the phrase can be misconstrued. Is it one "act play," or is it a play with one act? Adding the hyphen removes the mystery.
I hope this helps!