Your conclusion is good, but your reasoning is not. For instance 8 is a number which is not a perfect square yet has a repeated factor.
A correct way of reasoning this goes as follows:
The number of times the n'th light is pulled is the same as its number of factors.
It will be on if and only if there are an odd number of factors.
If you write out the prime factorization of a number, P1n1 * P2n2 * ... * Pmnm, then the number of factors the number has is (i1 + 1)(i2 + 1)...(im + 1)
This is odd if only if i1, i2, ... , im are all even.
This is true if and only if n is a perfect square.
From 2) and 5), the n'th light is on if and only if n is a perfect square.