Actually, wenn has more than just these two meanings but most times it is unambiguous. In context you will nearly always understand which one is meant.
Wenn ich zu deiner Party gehe, bringe ich einen Salat mit.
It's obviously that it is a condition because the subordinate clause is telling about what I'm gonna do if the part of the main clause will be true. With this subordinate clause the temporal meaning makes no sense at all.
You can try to replace wenn with falls:
Falls ich zu deiner Party gehe, bringe ich einen Salat mit.
The second use of wenn is a bit ambiguous:
Ich sage dir Bescheid, wenn ich losgehe.
Try to replace it with sobald and falls:
Ich sage dir Bescheid, sobald ich losgehe.
Ich sage dir Bescheid, falls ich losgehe.
It's most likely temporal meaning (sobald) because the combination of falls + losgehen is untypical. (you would rather say falls ich gehe). In very few cases it would be possible, though.
So, in general both could be possible and if so the speaker should replace wenn with sobald or falls or we need more context.
Ich gehe morgen zur Party. Ich sage dir Bescheid, wenn (sobald) ich losgehe.
Ich weiß noch nicht, ob ich zur Party gehe. Ich sage dir Bescheid, wenn (falls) ich gehe.
The next temporal meaning of wenn express repetition:
Wenn ich zu einer Party gehe, nehme ich (immer) Geschenke mit.
Here are two things important. First that you used immer (always). The second point is the plural of Geschenk. Without always and without plural it would be a condition:
Wenn (Falls) ich zu einer Party gehe, nehme ich ein Geschenk mit.
Adverbs of time (always, never, sometimes) and the use of plural like that (without article or personal pronoun) indicate that this refer to a regular action (Whenever I go to a party)
Note the difference if there is a personal pronoun:
Wenn ich zu einer Party gehe, nehme ich meine Schwester mit.
Because of the personal pronoun the meaning of the sentences changes. Wenn is the condition that must be true, otherwise the subordinate action won't happen. But when you add immer to this sentence you are back in the temporal meaning (Whenever you do A, you also do B).
The next wenn means although:
Wenn ich auch müde war, bin ich zur Arbeit gegangen.
Here the important word is auch. The combination wenn auch (or auch wenn) is literally even if/even though.
Wenn can also express a wish:
Wenn wir doch nur gewonnen hätten.
Without doch nur it would be a condition (Wenn wir gewonnen hätten, wären wir nicht abgestiegen), but adding doch, nur or both to a condition you express that that is a wish. You still can add as subordinate clause what had happen if your wish(the condition) were fulfilled. Usually you add dann or so to the subordinate clause:
Wenn wir doch nur gewonnen hätten, so [or dann] wären wir nicht abgestiegen.
And last but not least:
Er schaute mich an, als wenn er mich nicht verstanden hätte.
In combination with als or wie you describe in the subordinate clause what you've mentioned in the main clause. You do that with a comparison: He looks at me as someone looks like when he don't understand (Note: this is not the literally translation, just what it expresses)