According to Pokémon Go Hub, in order to receive a Fast TM from a raid battle, you need to be trainer level 15 and to receive a Charged TM, you need to be level 25. These are the only requirements.
After potions were added to the raid reward pool, the drop rates for other items decreased significantly. From the link provided in the other answer, this is the new distribution spread:
That is, you will have at most a 12.5% chance to receive either type of TM from a Tier 5 raid and as low as a 2.5% chance to receive one from a Tier 1 raid.
Prior to raid reward rework:
As mentioned above, the drop rates for these are very low, but your odds are better if you take on a more challenging raid. Based on a small study done in this thread, the odds for obtaining at least one TM from a raid range from 11% at Tier 1 to 14% at Tier 2, to 40% at Tier 3, and up to 64% at Tier 4.