他游了一个小时的泳. What is the grammar rule for separating 游 and 泳
It's because grammatically 游泳 is 离合词, which means it's separatable.
Baidu also gives other examples there, such as 睡觉, 吃饭，etc.
So, we can say 睡一个小时觉，吃个便饭，etc.
的 is 助词(auxiliary word) used after an attributive phrase.  一个小时的 is an attributive phrase modifying the noun 泳.  的 is omissible in your example.
PS.  泳 intrinsically is a verb, and here it's used as a noun.