For example today, the different states got called at various points of the day. Probably the decision to call has something to do with the margin of current count and the current percentage of reported votes, but I'm not able to infer a clear pattern. Is there a formula, or is it a judgement call by the network's experts?
It's a judgment call.
They tend to use a combination of exit polls, voting results, and expectations. For example, if a lot of returns have come in white neighborhoods and most black neighborhoods have not returned results, they might expect that Hillary Clinton's results will improve. However, if things are switched the other way, then Bernie Sanders could be expected to improve. If all the data are in line, they'll call earlier than in a race where there is more conflict in the data.
Relevant link: http://ajrarchive.org/Article.asp?id=519