Hi
Welcome to the world of 3D printing.
Before we go in to how to convert files into G-code let us understand what is G-Code
The program which does the conversion is called a Slicing Program. As the name suggests, it slices the the model in to fine layers. This slicing has to be dimensionally correct.These slices are then used to calculate the path and extruded material for each layer so that, the data can be converted in to a form to help the printer move its components correctly to print a perfect 3D model.
This process is not unique to 3D printing, it is also used in CNC machines too.
Conversion.
The conversion is carried out using programs such as Slic3r, Skeinforge, Replicator-G Pronter face etc. while most of them are free to download there are commercial applications too such as Netfabb. Down and Install them. These programs ultimately will run your printer. So the tip for slicing is to basically define your end product or print in terms of settings on these software, for e.g. Wall thickness, Fill density etc.
Hope I have answered your question.