I agree with bobthechemist's comment.
When you are determining the electronic configuration of anions/cations, you will first need to determine electronic configuration of neutral atom. Like in the case above:
$$\ce{Gd} : \mathrm{[Xe] (6s)^2 (4f)^7 (5d)^1}$$
Now arrange this configuration according to ascending value of $n$:
$$\mathrm{[Xe] (4f)^7 (5d)^1 (6s)^2}$$
Now, according to your need start subtracting electrons from highest value of $n$, like for $\ce{Gd^3+}$, the electronic configuration will be:
$$\ce{Gd^3+} : \mathrm{[Xe] (4f)^7}$$
See this to know more on calculating electronic configuration of cations and anions.