Ammonia and nitrite are highly toxic to fish in very low concentrations. There are special bacteria colonies that quickly convert ammonia and nitrite to nitrate. This is crucial to creating a healthy environment for fish. Nitrate are far less toxic, and can easily be removed through periodic water changes or consumption by live plants. Most fish in new tanks dies because of the lack of an established nitrogen cycle in the tank. There is even a term: New Tank Syndrome (NTS), which describes a tank that does not have the necessary bacteria colonies, and kills fish as a result.
Every new tank must under go what is known as Cycling. During this time you must closely watch your tank and monitor the levels of ammonia, nitrite, and nitrate. By monitoring these parameters you will be able to tell when your tank has become habitable for fish, or if it is still in the Cycling phase.
The first thing that happens when you put fish in the tank is ammonia is produced. This is from the fish waste or excess foods that are decomposing.
As the amount of ammonia starts to increase, a bacteria forms called nitrosomonas. This bacteria begins to convert the ammonia into nitrite. As the ammonia is converted to nitrite, the amount of ammonia will begin to drop and now the nitrites will begin to rise. Soon your ammonia test will show no more ammonia in your tank. This usually happens within the first week and a half of a normal cycle. Nitrite is also very toxic to fish, though not as hazardous as ammonia.
As the nitrite levels increase, another bacteria forms, called nitrobacter. This second bacteria begins to convert the nitrite into nitrate. As it is converted to nitrate, the amount of nitrite will drop and the nitrates will begin to rise. Soon your nitrite test will show no more nitrite in your tank. This happens between three to six weeks in a normal cycle. Nitrate is harmless to fish but is one of the nutrients that plants and algae need and is the final product produced in the nitrification cycle. One of the reasons that water changes are recommended is to keep nitrates at lower levels.
The time it takes to cycle an aquarium can be sped up by 'seeding' the aquarium with commercially prepared bacteria. Then the entire cycle will only take between 1 - 2 weeks. This seed bacteria is available in either a freeze dried or liquid form. You can also add bacteria rich media from an established aquarium, like some of the gravel. The seeding should be done after ammonia is starting to form in the newly setup aquarium. You must wait until there is ammonia or the seeded bacteria will starve.