You should try to get your source image as clean and rich as possible before trying to process the signal in any way. These controls modify the way the camera converts an incoming light intensity to an outgoing signal voltage. This is actually a gross oversimplification, but it does help see how these two parameters affect the image. Increasing the gain increases the range of voltages produced from a given range of intensities. This increases the contrast, increasing the size of the peaks in the graphs shown previously.
Gain amplifies the signal.
Offset, on the other hand, is additive, adding or subtracting a bit from the voltage. In the previous graphs, this would shift the plotted lines up and down. Increasing the offset a small amount noticeably brightens the image, which can be seen in both the image and the graph, which has shifted upwards. The contrast of this image has not changed at all. Changing the offset would add a small amount to both the maxima and the minima in the graph.