Amino acids are made up of an amine group, a carboxyl group, a hydrogen and a variable group (often noted as R) all bound to one Carbon. These amino acids can bind to one another by the amine group and the carboxyl group at either end reacting to from a 'peptide bond' and a water molecule. Since water is produced this is a condensation reaction (the reverse is a hydrolysis reaction.) This binding can continue to occur creating a long chain of amino acids known as a polypeptide (poly- meaning many and -peptide referring to the name of the bond which holds the amino acids together.) This long chain is the primary structure in protein synthesis. As the protein is developed in the organelles of the cell hydrogen bonds begin to from between the variable R groups of the many amino acids, this forms 2 types of structures. Beta-pleated sheets (like corrugated iron) and alpha-helixes (similar to a single strand of DNA). These are secondary protein structures. Tertiary structures get even more coiled and folded due to variety of bond occurs between the variable R groups (such as disulfide bonds, ionic bonds, more hydrogen bonds and hydrophillic/hydrophobic interactions.) The final stage in the structure of a protein is where multiple (often 4) of these tertiary polypeptides come together and bind to complete the structure of the protein.
As you can see the various combinations of multiple different R groups in different orders can lead to different bonds in different places which leads to a different shape and structure. This structure allows the protein to have its own specific functions.