Taking the name straight from the Variable Label in the data file in the case of single response question types (e.g., Pick One, Date and Number questions).

Taking the name from any Multiple Response Sets specified in the data file.

Inferring the name from common structures in the labels. For example, if two variables are grouped into a question and contain the label of Q5a. Bank of America and Q5b. Citibank then Q will infer that the Q5 is common and use this in the variable name (in this case, Q will create a name for the question of Q5X, where X indicates that Q has inferred there is a sequence of numbers).