Can't really tell you without knowing where you're coming from. If you're coming from East Kilbride then the last one is 22:57. If you're coming from Mallaig then the last one is at 6.03 in the morning.
Check the Scotrail website and that will tell you.