Way way back when, Porsche was an engineering company headed by Dr. Porsche that did design work... mainly for other automotive companies (such as Mercedes and Auto Union). Their work was generally distinguished by a project number (just as today, though most companies seem to use names... but that really wouldn't be classic German efficiency).
After WW2, when Porsche formed as an automotive manufacturer, they continued the same process for identifying their projects with project numbers: the 356 project (which was the Porsche 356), the 514 (which was the 356SL), and also things like the Jadwagon (which was 597). This also extended to other things like the 915, which was a transmission.
When Porsche was set to retire the 356, the replacement car was project 901 (and the 4 cylinder version, the 902). However, with Puegot threatening legal action as they considered car models of a three digit format with a zero in the middle to be their trademark, Porsche decided it was easier to change the names to 911 and 912 rather than fight with Puegot.
The cars that are typically called 911 were originally Typ 901, followed by 911, then 964, 993, 996, and now the current 997 (and if you go way back, the pre-production prototypes were 695 and 754). Though most recognize them still by the name they were originally sold under "911."
And, as already pointed out, not all Porsches are 911s (their are 356s, 718s, 904s, 908s, 930s, 931s, 936s, etc).