I notice a lot of folks would pray to Allah SWT to survive through a disease or have a long life.

But, from what I understand, our deaths are already written, and we can’t hasten or prolong them right? I think there are ayahs on this but I can’t think of any in my head.

If I’m right then, am I wrong to pray for the long life of myself and family members?

You should pray for a long life in the service of Allah. And yes it can change the outcome, everything is in Allah’s hands.

يَمْحُو اللَّهُ مَا يَشَاءُ وَيُثْبِتُ وَعِندَهُ أُمُّ الْكِتَابِ

Allah makes to pass away and establishes what He pleases, and with Him is the basis of the Book.