When referring to a particular month, (January, February and so on) it reads がつ as you mentioned:
一月【いちがつ】 January
二月【にがつ】 February
三月【さんがつ】 March
四月【しがつ】 April
五月【ごがつ】 May
六月【ろくがつ】 June
七月【しちがつ】 July
八月【はちがつ】 August
九月【くがつ】 September
十月【じゅうがつ】 October
十一月【じゅういちがつ】 November
十二月【じゅうにがつ】 December
何月【なんがつ】 What month
However, when counting periods of time that span months, it is read げつ:
一ヶ【いっか】月【げつ】 One month
二ヶ【にか】月【げつ】 Two months
三ヶ【さんか】月【げつ】 Three months
四ヶ【よんか】月【げつ】 Four months
五ヶ【ごか】月【げつ】 Five months
六ヶ【ろっか】月【げつ】 Six months
七ヶ【ななか】月【げつ】 Seven months
八ヶ【はっか】月【げつ】 Eight months
九ヶ【きゅうか】月【げつ】 Nine months
十ヶ【じゅっか】月【げつ】 Ten months
十一ヶ【じゅういっか】月【げつ】 Eleven months
十二ヶ【じゅうにか】月【げつ】 Twelve months
何ヶ【なんか】月【げつ】 How many months
Note that the small 「ヶ」 is read 「か」.
For the rest of words that use 月, I don't know if there's a rule. In general, I just memorise the reading for each word outright.