In 1864 during the civil war both republicans and democrats had internal conflicts about leadership and the war. In order to create a majority, those republicans loyal to Lincoln decided to create a new party name in order to form a collation with pro-war democrats. The new party name got called the National Union Party.
Lincoln died the next tear in 1865. The next year after, in 1866, the new National Union Party leader failed to maintain the coalition and Republican members left, with the remaining democrats leaving short after.
"what party was abraham lincoln in" is thus a question about time. He was party leader under three different party names, president under two, and leader of one coalition that spanned between two parties. He spent 15 years as a Whig, 10 years under the republican name and 1 year under the coalition which is the point of his death.