How many Scottish accents are there?

In terms of accents, there are literally hundreds of different accents in Scotland, all varying from place to place. Scotland is unique from many other countries in the British Isles or Indeed Europe for the fact that accents can vary from town to town.

For example, someone from Bonnyrigg in the Midlothian Region of Scotland, will speak differently from someone that lives in Gilmerton, only a few miles away. And someone from Edinburgh, will speak very differently than someone from Glasgow. Scotland's accents vary from location to location rather than from region to region like in other countries.

Additionally, you then have to take into account the three languages of Scotland; Scots, English and Gaelic... all of which, again, have their own locational accents.

You would literally have to study everyone in every inch of the country to know a definitive answer, but to say hundreds is probably best.