If you plan to spend longer than three months in Gran Canaria, you need a long term work and residence visa. You have to apply for this kind of visa from your home country via a Spanish consulate. See this article for a useful summary of the paperwork you need to apply for a work and residence visa.