Up to 50% of the market value of the scheme can be used.
If the pension scheme is  an occupatioal pension and the money is lent to the sponsoring employer the loan shouldn't be granted for more than 5 years, but under certain circumstances the loan can be extended by up to 5 years.
HMRC Pensions Tax Manual - PTM123000:Investments: loans