The process in which a relatively unspecialized cell acquires specialized features of a stem cell. A stem cell is a cell that retains the ability to divide and proliferate throughout life to provide progenitor cells that can differentiate into specialized cells. [ http://purl.obolibrary.org/obo/CL_0000034 GOC:isa_complete ]