The accepted answer is wrong - wildly wrong.
The last snap election in the UK took place in May 1979, when the Callahan Labour government fell after losing a vote of No Confidence in Parliament.
But there has not been one since 1979, in theory.
In reality, the most recent snap election was just held, it was called (and lost) by Theresa May immediately after the 2016 Referendum, when she threw away her party's Commons majority in 2017 by calling an unnecessary general election.
However, when Mrs Thatcher was Prime Minister, during the 1980s, she never allowed herself to get boxed-in. She always called a snap election, when there was still at least a year to go. She acted when her Opinion Poll ratings were strongest. So there was an election in 1983 (4 years on from 1979), and in 1987 (4 years on from 1983).
Tony Blair, too, was too clever to get boxed-in. He also called elections every 4 years: coming to office in 1997, he called an election 4 years later, in 2001, and again 4 years after that, in 2005.
All these were 'snap' elections, i.e. held before the full 5 year term had expired.
1979 was the last time a 'snap' election occurred because of a government losing a confidence vote in Parliament, but many have occurred for other reasons since. Theresa May was the first PM to call one of his or her own choosing and lose it: Thatcher and Blair only called them when the political situation was favourable. They were too smart to call them voluntarily and lose.
Back in history, they were fearsomely frequent. In the 1960s and '70s Harold Wilson was constantly calling them. In 1966 he held one after only 2 years in office, then held another just 4 years later in 1970. And in 1974 he managed the all-time record, calling the October 1974 election less than a year after the one held in February '74. The February one was itself a 'snap' election, too. Heath did not need to call one in the dying days of 1973, he could have legitimately gone on until 1975.
So, snap elections are very common.
Historically, those Prime Ministers who were too timid to call a snap election usually lost: Atlee lost in 1950, Sir Alec lost in 1964, Callahan lost in 1979, John Major lost in 1997, and Gordon Brown lost in 2010: in all those cases, the incumbent allowed himself to be boxed-in by waiting until the last possible moment, where the 5 years were up, and found he had left himself no room for manoeuvre.
There seems to be a 5-in-7 chance of losing if you wait too long: only John Major, in 1992, and David Cameron, in 2015, survived after letting the full 5 years run out on them.