Since 2006, the driving license in Spain it works with a point system For which all drivers are generally associated with a balance of 12 points. As traffic offenses are committed, points are subtracted to zero, at which point their driving license is withdrawn.
But, whether you have lost some points on your card or if they have been withdrawn for having exhausted all your points, you can perform reeducation courses in concerted centers for a partial recovery of points or the recovery of permission that you have lost. On this search engine of the General Directorate of Traffic (DGT @DGTes) you will be able to find the list with all these centers.

In practice, when you obtain the license for the first time, as a new driver, you have 8 points on your license, to which four more are added when you accumulate three years of experience. After three more, if you do not commit traffic offenses, you earn an additional two, plus 1 extra for 0 offenses in 6 years. So, if you are a good driver, you will have a maximum of 15 points. Points are associated with the driver, not with a specific type of permit. For this reason, the points are common to all the driving licenses you have, in such a way that if you lose the validity of your license, you will not be able to drive any type of vehicle.
Theoretical test
If you have lost all the points on your permit after committing several serious or very serious traffic offenses, you should know that the cost of the recovery course for the driving license or driving license in terms of road awareness and re-education will be at your expense, and that will have twenty-four teaching hours, with contents that have two different parts: in the common part, a general training on matters related to road safety is addressed and group dynamics dedicated to reflecting on the objectives of the course are put into practice . The specific part, as in the partial point recovery courses, is also individualized and is oriented to the areas in which the driver has the greatest needs.
Once the expiration date has expired, 6 months for drivers in general and 3 months for professional drivers, you must pass a theoretical test on the subject of the course taken. To take this test, you must request an exam appointment at your Headquarters or Traffic Office.
The cost of taking the partial or total points recovery courses are available on the DGT website:

(Source: DGT)
Prices vary a bit if the courses are held in the Autonomous Communities of Catalonia or of Basque Country. In any case, the courses are paid directly at the associated center where you are going to take it and its normative it is regulated by the Ministry of the Interior.