If you are referring to the composition of the epic, it is difficult to pinpoint it precisely since it was primarily oral and continued for a considerable period of time. In any case, most modern scholars estimate that it occurred around the 8th century BC. The Iliad was probably completed first, followed years or decades later by the Odyssey.
The best-known step in this process, in terms of writing it down, occurred under Peisistratus, the tyrant of Athens in the 6th century BC. Among his other public works, Peisistratus ordered copies and archives of Homer's epic poems, thus creating a fixed version. Before that time, others may have written at least some parts of the epic, but there is little information.
Which famous Greek wrote "The Iliad" and "The Odyssey"?
You mean Homer? But if you put it bluntly, people would argue whether he ever "wrote" the Iliad and the Odyssey. He might simply have been a blind performer—a bard, if you will—who recited his poems from memory. (Hard to do, but maybe that's all he does for a living!) At some point, someone wrote all the lines... and he almost performed them as songs. This is what the ancient "poets" did, and this is why epics, like all poetry, are written in verse. Because in ancient times, poetry was sung more than it was written or spoken.
Which poem is longer, the Odyssey or the Iliad?
The Iliad is about 16,000 lines long, while the Odyssey has 12,000 lines of hexameter, with two or three rhyme schemes. One of the reasons for the length of the Iliad is that it contains a lot of "military organization" material, such as catalogs of the men and ships involved, particularly on the Achaean side.