These two concepts - moksha and samsara - refer to the ultimate goal in Hinduism which is, quite simply, escape from the cycle of life, death and rebirth and to re-merge with Brahman, or ultimate reality.
The cycle of life, death and rebirth is called samsara.
Escape from this cycle is called moksha, which means "release."
How is this escape achieved? Through making progress on the spiritual path and neutralizing all negative karma.
So, the basic life condition for every person is that they are an atman, or soul, who is transmigrating from life to life, existence to existence, all based on the effects of karma. This cycle of reincarnation may happen many hundreds, even thousands of times until the person achieves the highest spiritual state.
At that point, when the person dies, they no longer are born back into the cycle of life death and rebirth. Instead, according to one of the largest schools of philosophy in Hinduism - the Vedanta school - the atman reunites with Brahman and is never born again into cyclic existence.
This is the ultimate goal of Hinduism: re-merging of the atman with Brahman.