Your signal has a dynamic range (max to noise level). Your ADC has a dynamic range (full scale to noise level).
Let's say your ADC has a larger dynamic range than your signal. Congratulations, you have a choice of gains to use. The maximum usable gain is the ratio of the max and full scale, use any more and it will overload your ADC. The minimum useful gain is the ratio of your noise levels. Using less gain will further degrade the noise level on your signal. Pick a gain somewhere in that range and rejoice. You may want to think whether there's any way you can improve your signal noise at source.
Let's say your signal has a larger dynamic range than your ADC. The range of gains suggested above has just vanished to nothing. The only thing you can do is set the gain at the ratio of the max signal levels, as an overloaded ADC is a non-working ADC. You have to suffer the fact that the ADC limits your noise, and you may want to think about getting a better one, or averaging readings to improve the noise.
Unless - the signal isn't at its maximum all the time, but only sometimes. Then you may be able to use switched gain to improve things. Set the gain to the ratio of the present signal maximum and your ADC full scale. If it overloads, turn the gain down. If the reading is persistently below some threshhold, say half scale, then turn the gain up to improve the noise. If you can tolerate the downtime of the occasional overload, then this works. There are variations on this, for instance use two ADCs with different gains. Choose the largest signal that isn't overloaded.