Russian surnames ending in -ов, -ев, and -ин (such as Пушкин, Чехов, and Гагарин) belong to a special mixed declension. They combine standard noun endings with a few adjective endings.
Masculine Surnames
For men, these surnames decline exactly like standard animate masculine nouns in almost every case. For example, they take -а in both the Genitive and Accusative cases.
The one exception is the Instrumental case. Instead of a noun ending, masculine surnames take the adjective ending -ым.
Feminine Surnames
Feminine surnames end in -ова, -ева, or -ина (like Иванова). They decline like a standard feminine noun only in the Accusative case, taking -у. In all other cases (Genitive, Dative, Instrumental, Prepositional), they take the feminine adjective ending -ой.
Plural Surnames (Families)
When referring to a family as a group (like "the Ivanovs"), the surname takes the plural ending -ы. In the plural, these surnames abandon noun endings entirely and decline exactly like plural adjectives across all cases (such as -ыми in the Instrumental).
You will frequently use these specific declensions when discussing the творчество (creative work) or биография (biography) of famous Russian creators and pioneers.