This is a complicated topic and the answers given in this briefing provide an overview of the basic position – ie they do not take into account the legal implications of any future relationship which may be negotiated with the EU (for example, if the UK joins the European Economic Area).
It is likely, therefore, to need updating over the course of the coming months and years as the UK’s withdrawal from, and future relationship with, the EU is negotiated.