From what I am aware on a personal point of view i think the license
is given on individual blocks,the different blocks are registered or may be registered at different times so if for example you have 10 blocks of apartments, some may get there license quicker than others.
I have in my hand such a certificate issued for a new building in Lliria by the local council in the name of the Valencian regional government. It is clearly issued for an individual apartment and is not applicable to the entire building. It is also issued to the individual who bought the originally off-plan flat rather than the developer.
It is competency of the Local Planning Authorities and it is a matter that as an applications and granting procedure is regulated by them.
There are some local Councils which authorise Habitation Licences on phases of the same developments if, in the Works Licence, the construction is divided into phases.
But definitively, it is necessary to have allok on the local regulations.