I am in my first year studying German, and I couldn't not notice that some adjectives form from nouns with -ig (e.g. salzig, vorsichtig), others with -lich (monatlich, sommerlich etc.), and others with -isch (typisch, telefonisch). Is there a rule defining which ending to use when?
There is no clear-cut rule. Any rule I am about to lay out now has a dozen exceptions to it. But a few similarities do stike me once I try to think about the suffixes.
First, -isch is the only element in your list that can be added to geographical places:
türkisch, italienisch, europäisch, wienerisch, hessisch, …
-isch is also used to detonate the means of doing something:
postalisch, telefonisch, technisch, lautmalerisch
and that probably also sums up adjectives from scientific disciplines, although I can't pinpoint it directly:
medizinisch, chemisch, geographisch, altphilologisch
-lich, according to the etymologies linked in the comments under the question, derives from an old and obsolete word for body and shares a common root with Leiche (corpse). So it originally meant something, whose body/shape was of kind x.
sommerlich (as in summer), merklich (can be realised), deutlich (can be heard), willentlich (made of free will), männlich (like a man), …
The suffix can also be used much like the English -ish but not with many adjectives:
gräulich, bläulich, ärmlich, …
because with others it will create a new word with a different meaning:
It's also productive to give every <timeframe>:
täglich, monatlich, wöchentlich, zweiwöchentlich, stündlich, jährlich, augenblicklich
But note that these can also be connected with -ig:
The difference is: Something that is zweiwöchig will take two weeks and then be finished; e.g. an internship. Something that is zweiwöchentlich happens every other week, e.g. a football team's home match.
-ig is probably the most productive of the three (unless you count every single geographic entity on earth, in which case -isch might win), because it was used as a suffix in very early Germanic times. It is the suffix to turn a word into an adjective meaning of this type:
rosig, glasig, farbig, wässrig, grasig, lausig, gängig, sonnig, schnittig, putzig, witzig, schokoladig, teilweisig, …
If you want to create a new word, your best bet is -ig. It is also the only one that can turn adverbs into adjectives (usually -weise-adverbs).
And here is where it gets complicated. You can get pairs of adjectives with different suffixes:
geschäftlich – geschäftlicher Besuch is a visitor from a company who's probably going to try and sell you something.
geschäftig – geschäftiger Besuch is a visitor who just can't stop doing stuff; whatever "stuff" is.
telefonisch – by telephone
telefonig – something that looks like a telephone, but is not.
The answer by Jan is already very good. For the sake of completeness, I’d like to translate / summarize / quote what the Duden has to say on this exact topic (Adjektive auf -ig, -isch, -lich):
The ending -ig means that the denoted characteristic is present:
nebelig = there is actual fog
The ending -isch is often used to build adjectives from living things / people, and then means “in the fashion of an x”:
diebisch / künstlerisch = in the fashion of a thief / artist
But -isch is also used to form adjectives from other nouns and then means that something “belongs to x”:
grammatisch / griechisch = belongs to the realm of grammar / Greece
Words ending in -lich are the most neutral and tend to just mean has something to do with X:
ärztlich = has to do with a physician.
Jan already pointed out that the same base noun can have different adjectival suffixes to denote different attributes. In addition to his elaboration, Duden has the following:
If two adjectives are built from the same noun, one with -lich and one with -isch, then -lich usually just denotes that something belongs to x, whereas -isch has a pejorative connotation:
All Bauern are bäuerlich, because they pertain to the category of peasants, but not all of them are bäurisch, because they are not necessarily country bumpkins.