....기 may contains basically a manner of time(tense) or planning.
For example, (나중에) 운동하기 (exercising (later)), or 10시에 운동하기 (exercising at 10 o'clock)
so that, ....기 involving tense or planning is a complete sentence ended by ...기
....는 것 contains the meaning of a conduct
For example, 운동 하는 것 (exercising or to exercise)
...는 것 can be easily defined as conducts.
However, ...기 is complicated. If you add a suffix (which can be added to a noun and makes it the subject in a sentence), then it becomes interchangeable with ...는 것.
For example, 운동하기가 어렵다 (it is hard to exercise)
As this example shows, ...기 + 가 makes it a conduct.
And also, ....는것 + a suffix is only implying a conduct.
In short, ...는 것 is very clear to use, and if ....기 is used as a subject then both are interchangeable
if a phrase ends with ....기 then it contains time, so what I suggest you is to use no matter what you choose.
Oh, additionally, after all this comment, I realized that ....기 also includes one's expectation.
If your girlfriend ask you 10시에 운동하기 then she expect you exercising at 10 o'clock, and my reply from your first question indicates 가져오 기를(길) 원했다 also includes your girlfriend's expectation.
Anyways, you can use either. the use of ...기 including time, planning, or expectation is likely 10%-20% of all time I guess.