To dream of prison is a metaphor. In waking life, you’re probably trapped in a predicament which requires some time to overcome. If you dream of being in prison for a short time, it means your problem will be solved after a short period of time. If you had been dreaming of a long prison term, it means your situation in waking life requires a long time to resolve.
If you dream of a relative in prison, and in waking life you have not heard from them for ages, then your dream may be true. Sometimes, the manifest imagery of a prison has a slightly different latent meaning. The dream symbol of prison may mean the person is prevented from leaving a situation.