I'm currently in first year in St. Andrews and I was slightly worried about this as well. Compared to universities in bigger cities the nightlife isn't fantastic but it's not bad, there's a club in the union, plenty of bars, societies, flat/house parties and always lots going on in town. Dundee is also only half an hour away at most on the bus and they have one of the best student unions in the UK and loads of clubs, it's a great night out there if every now and then you want to go somewhere a little more varied and busy. Glasgow and Edinburgh are also only an hour or two away on the train and bus. There are definitely a fair few stereotypical St. Andrews students but honestly most students aren't like that at all and it's a great place to be