EU citizens and their families currently have the right freely to travel, live and work across the EU. If the UK leaves the EU then this could have wide ranging implications, as UK citizens and EU citizens of other member states would no longer enjoy this automatic right of free movement to travel, live and work in EU/EEA member states. This restriction on movement would have a significant impact on current and future labour and trade markets in the UK and the EU and global trade outside of the EU.
If the UK leaves the EU then it could impose its own controls on who was admitted to the UK and under what circumstances. EU nationals could be subject to the same visa rules and requirements that currently apply to non-EU nationals. If it is no longer bound by free movement law, the UK may have more powers to deter and restrict the presence of certain categories of EU migrants and more powers to remove/deport national immigration offenders. The flip side is of course that while the UK could impose its own controls on EU immigration, the rights of UK citizens to travel, move to or work in an EU member state would be restricted by any visa entry requirements or restrictions that EU member states chose to impose.
If the UK were to leave the EU then it is unlikely to result in any immediate changes as there would be a complex and lengthy transitional period. The UK would need to negotiate and agree on arrangements for its future relationship with the EU. Some EU nationals may have acquired rights to stay under UK legislation. For others, there could be reciprocal arrangements agreed between other EU countries so that EU nationals already working in the UK may be granted permission to stay in the UK and UK citizens working in other EU countries would be granted similar permission to stay in return.