There is no direct road connection from St. Petersburg to Key West. The Overseas Highway (US-1) begins in Miami, so you must:
Total driving time: ~8 hours, 425 miles (excluding stops).
Alternatively, take the Key West Express ferry from Fort Myers Beach (~3.5 hours) after driving there from St. Petersburg (~2.5 hours).