Annexed by Russia between 1865 and 1885 , Turkmenistan became a Soviet republic in 1924 .