I tried understanding 苟且偷欢 word by word. However, I don't think 'improperly stealing happiness' is the correct answer, does the word '欢' have slang/idiomatic meanings except joyous or happy?
「偷」has a less negative meaning (than stealing) of finding time (to do something), which is the meaning in this context. For example,「偷暇」means to find a (fleeting) moment of leisure.
「苟且」, in this context, is more accurately translated as perfunctory (doing something to attain minimal standards, or doing something with minimal effort), so「苟且偷歡」is to be content with temporary happiness.
EDIT: Since the OP has posted the context of the phrase as
(My) bastard wife and that sneaky bachelor "苟且偷欢" whenever they can
then Tang Ho's point about illicit relations is the correct interpretation:
(My) bastard wife and that sneaky bachelor jump into bed whenever they can
The common idiom is 苟且偷生
【拼音】：gǒu qiě tōu shēng
【注音】：ㄍㄡˇ ㄑ｜ㄝˇ ㄊㄡ ㄕㄥ
"苟且偷欢" is not a standard idiom. It replaces '偷生' (barely avoid death/ improbably stay alive) with '偷欢' (secretly coupling)
苟且 as an adverb means "perfunctorily"
苟且偷生 means "disgracefully stay alive"
The phrasing of 苟且偷欢 implies 苟且(adv) (perfunctorily) + 偷欢 (v)(secretly coupling) which doesn't make much sense, but 苟且 also mean 'illicit (sexual relations)' 苟且偷欢 would means " illicit coupling"
It is not a common phrase
偷欢 synonyms 偷情