At an estimated time of ~4 billion years, the first "simple" cells have evolved in the surface of the earth. However, the atmosphere and condition of the earth in those times is completely different compared today. Life should exist first before it will start to evolve and eventually complicates to form the modern kinds of organisms. Life had to come from somewhere, perhaps from non-living entities in the atmosphere/environment, having spontaneous reactions that will lead to life. The outside forces or the environment is an important factor in determining if the formation of life would be possible.
The formation of the first cells has been theorized to have formed in the Archean Eon (3.8 - 2.5 billion years ago). During this time, the Earth's crust has cooled down (from successive volcanic eruptions) as rocks and plates continued to form. It lacked free or abundant oxygen in the atmosphere and liquid water. Now the first cells perhaps thrived under the rocks and continuously produce oxygen thus changing the entire Earth's atmosphere from that point in time.
Due to lack of actual evidence, it is even now difficult to decide whether origin of cells and of later groups of organisms evolved monophyletically or polyphyletically. Without involving in this problem, best evidences at present suggest that the first cell or cells probably arose some two billion years after the origin of earth, that is perhaps three billion years ago. It is believed that cell is the major product of the first few billion years and cell is considered as being alive. The earlier organic compounds dissolved in the ocean already possessed the properties that eventually made the life possible.