1. I gave it up because of the rain.

2. I gave it up because of rain.

(Which one is correct? Do we have to use 'the' or not. )

They are both correct. The first one is indicating a particular rainstorm, while the second one is referring to rain in general, whenever it may happen.