Are both 他游了三个小时泳 and 他游泳游了三个小时 fine?
You can say 他游了三個小時泳. People will understand it, but it doesn't sound as smooth as 他游了三個小時的泳. However, that's still not the best way to say it. You should just say 他游了三個小時 or 他游泳游了三個小時.

的 will make it sound more smooth, but it doesn't change the meaning at all, not even emphasizing.