The process by which cells become specialized and assume specific functions within different tissues and organs.