Cell specialization happens towards the end of embryogenesis (which comprise of cell division and cell differentiation) when the cells have distinct function and specialized structure.
Throughout embryogenesis, cells divide until they form morula phase (which comprise of blastomere cells). Cell division continues until it forms blastula (which comprise of blastocoel, embryoblast and trophoblast). [Ref1] Gastrulation phase occur after blastula phase and are comprised of ectodermal cells, mesodermal cells, and , endodermal cells. [Ref2]
After gastrulation phase is organogenesis phase where cell specialization occurs. For example, during formation of myotome (which are cells that makes up muscle cells), cells from mesoderm will differentiate to become somite, then sclerotome and subsequently to myotome. This will later go on to form muscle cells.
Other specialized cells include adipocyte (which have a really large organelle that stores fat molecules), osteocytes, melanocytes and red blood cells.