Housing benefit is a non-contributory but means-tested benefit. This means that it is not linked to National Insurance contributions.
However, if you have capital (including savings, shares and property other than your own house) of over £16,000 you can claim housing benefit but it will be unlikely that you will be entitled. Housing benefit is claimed through the local council and can entitle you to other benefits.