Sanskrit is used to refer to several different languages. It's often ambiguous which one people are referring to when they say Sanskrit. Classical Sanskrit is the only one which wasn't spoken as a common language.
Classical Sanskrit -- the language codified by amongst other Panini, around the 5th century BC, which was used for religious and secular purposes for high culture and amongst the political elites.
At this time, some of the other languages now called Sanskrit had turned into the "Middle Indo-Aryan languages", including Pali, and the Prakrits, whose descendents now include the modern Indo-Aryan languages of northern India, Pakistan, Bangladesh, Nepal, and Sri Lanka.
Vedic Sanskrit -- the language of the Vedas (1700BC-600BC, approximately), believed in its earliest forms to be the common languages which then became some of the modern north Indian languages. Classical Sanskrit is a codification of Vedic Sanskrit.
Broadly -- any Old Indo-Aryan language, including the pieces of Mitanni Aryan attested in inscriptions in northern Iraq/Syria/Turkey embedded in other language texts including Kikkuli's Horse training manual (mostly in Hittite, except where he uses "Mitanni Aryan" words in glosses and defines them), and king names in the Hurrian language, which are meaningful when interpreted as Sanskrit.