Nobody really knows what will happen now, but the effect will not be immediate. The UK will continue to remain part of the EU. It is unclear when the formal exit procedure would be triggered, but it would likely take several months at least, especially if there are legal challenges to the outcome of the referendum. Since the referendum is not legal binding, a parliamentary vote on leaving the EU would have to be held as well. Given the fact that both Parliament and the courts will be in summer recess, this process could take until the autumn, or possibly longer. Some experts say that Britain may want to start negotiations before formally triggering the exit clause, to buy more time.
Article 50 of the Lisbon Treaty states negotiations on leaving the EU will end two years after the official notification has been made, unless all remaining 27 member states vote to extend the negotiations. In practice, this means that it will take at least two years, given the complexity of the negotiations. Even if things go quickly (or badly, so that a member state vetoes an extension of the two-year deadline), fully implementing a Brexit may take up to 10 years, not least because every single EU parliament would have to approve Britain’s exit deal, which would take many years.
In other words, a Brexit would very likely not affect students starting university in the UK for at least two years, and possibly much longer. Normally, once changes come into effect, they only apply to students starting their studies. If a Brexit happens in 2019, then students who will start their students in 2019 would be affected, but not those who started in 2018 or earlier, and for whom the old rules will continue to apply. And it is not unthinkable that a future agreement would leave the area of higher education completely untouched, with EU students continuing to enjoy the same status as UK students. In fact, students from European Economic Area countries (Norway, Iceland and Liechtenstein) are treated the same as UK students for fees purposes, even though their countries are outside the EU.
Divorces are always messy, and this would be a divorce without precedent.