I agree with Markus, although an internal standard can have two functions. If the IS is added at the sample preparation stage it will show you if you have 'lost' analyte if the IS is generally chemically similar to your analyte (similar polarity, functional groups volatility etc.); and it will help you see if you have problems with your injection.
You can get better control of the complete sample work-up and injection process if you add the IS as the last stage before injection and add a surrogate standard as the first step of the process. A surrogate should be chemically and physically similar to the analyte, so it will behave similarly to the analyte throughout the sample work up process - If the ratio of surrogate standard to internal standard is 'wrong', it is likely that your analyte result is 'wrong' too. With this method your IS does not need to be chemically similar to your analyte. The IS and surrogate should both be easily detectable; have a different retention time to your analyte (and any likely interferences); and should not be likely to be naturally present in your sample.
Thie IS with surrogates technique allows you to control the injection process (statistical analysis of the IS peak area over a number of injections), and your extraction and sample preparation by ratioing the surrogate standard to the IS.
Markus and Tim have rightly explained. This is just to elaborate more for you.
First, select a substance (the “internal standard”) other than the target substance. This substance must be stable, it must have similar chemical properties to the target substance, and its peak must appear near that of the target substance and be completely separated from the peaks of other sample components.
Prepare 4 or 5 standard solutions with different concentrations of the standard substance (X) and the same concentrations of the internal standard (IS), introduce the same quantities of these solutions to the HPLC, obtain chromatograms, and measure the peak area values.
Representing the value [Concentration of X / Concentration of IS] for the standard solutions on a horizontal axis and representing the value [Peak area of X / Peak area of IS] for the standard solutions on a vertical axis, create the kind of calibration curve. Then prepare a sample solution for measurement by adding IS to an actual sample at roughly the same concentration used with the standard solutions, introduce this solution under the same conditions, obtain a chromatogram, and find the peak area value.
Calculate the concentration of the target substance in the actual sample by obtaining the concentration ratio of X and IS (horizontal axis) that corresponds to the peak area ratio of X and IS (vertical axis), and multiplying this by the concentration of the added IS.
It will be useful if you can tell us what kind of detector you are using. If you are using a mass spectrometer as a detector for the HPLC the usage of the internal standard is a little different than if you are using a different detector, such as a UV/Vis detector. For example, if you are using a UV/Vis detector you will usually want your internal standard to have a retention time that is close to that of your target compound, but not identical, because if the peaks overlap you won't be able to know if you are detecting the internal standard or the target compound.
If you are using a mass spectrometer then for your internal standard you will want to use an isotopically labelled version of your target compound, and you will want the retention time of the internal standard to be the same as your target compound. You can distinguish the target compound from the internal standard by its difference in mass.
Still other considerations may apply if you are using a photodiode array for the detector, but I won't discuss that.