It depends on a lot of factors - how much you owe on the repossessed property, your income and employment status, how much deposit you have saved up, and your credit score are just a couple of areas that lenders would assess. Generally speaking, most people who have their home repossessed will need to wait at least two years before they can buy another one. The lender may also require a larger deposit than what is typically required for a standard mortgage.
But to be clear, there is no hard and fast rule about this, and it will depend on your individual circumstances. In time you should be able to buy a house after a repossession, this may be longer in cases where the repossession was caused by financial misconduct on your part. Also, keep in mind that the sooner you can start repairing your credit, the better your chances will be.
The reason why lenders will be cautious for a few years is because they will want to see that you've re-established yourself financially and are in a position to make regular mortgage payments.
Of course, there are always exceptions to the rule and some smaller and more specialist lenders may be willing to consider your application sooner. So, it's definitely worth shopping around and speaking to different banks and building societies before making a final decision. Ultimately, the wisest decision is to speak to a financial advisor who will fully review your entire situation.