The correct option is B 7
Valency of Sodium is 1, as it has distribution of elctron in its shell as 2, 8, 1. So it will loose one electron for gaining stability.
therefore, the element X will have the lectron gaining capacity of 1.
The only way it can gain one electron is to have a 7 electrons in its outermost orbit.
Alternative solution:
Since the element X forms compound with chemical formula NaX, it means, valency of X =1. The number of electrons in the M shell of an atom of X will be seven.