The process in which a relatively unspecialized cell acquires specialized features of a pacemaker cell. Pacemaker cells are specialized cardiomyocytes that are responsible for regulating the timing of heart contractions.