I think what Michal said is grammatically perfect expect for the tense. Since “I finished working” is a past sentence, Japanese sentence should be:
働くことを終わりました。
働くのを終わりました。
働き終わりました。
One more thing. If you’d like to sound more natural, you could say 「仕事を終えました」 using a noun 「仕事」 and a transitive verb 「終える」 or 「仕事が終わりました」 using the noun as the subject and an intransitive verb 「終わる」
(「終わる」and「~終わる」can be used as a transitive verb in some situations.)
For example,
“I started working” would be either 「働き始めました」 or 「仕事を始めました」 depending on the context.
“I go to work” would be 「仕事に行きます」. You could say 「働きに行きます」 but the previous sentence is more common.