Probably a sprain
Sprains of the hand, especially sprains of the small joints of the fingers, are typically stiff, swollen and sore for a number of months-it sometimes takes a year or more for the soreness to go away, and sometimes the swelling can be permanent.
It is a good idea to get a sprain
evaluated early to make sure nothing else is going on and to completely understand the condition. See a hand surgeon