Ad hoc is a Latin word which means "for this purpose". You can call it as "on the fly" query, or the "just so" query.
It's one kind of SQL query, that you just loosely type out where you need it.
var newSqlQuery = "SELECT * FROM table WHERE id = " + myId;
The above query is an entirely different query that occurs each time the line of code is executed, depending on the value of myId.
A predefined query such as a Stored Procedure is the antonym of an ad hoc query. Here, you have created the single query for the entire generalized purpose of selecting from that table (say), and pass the ID as a variable.