No, you usually do not need both; you provide either an invitation letter or a hotel booking depending on your visa type.
Choosing the right document
Most Pakistan visa applications require proof of accommodation, but this can be shown in different ways. You typically provide either an invitation letter or a hotel booking, not both.
For tourist travel
For tourist visas, a hotel reservation is usually sufficient to show where you will stay. It should cover your planned travel dates and locations.
For family or business visits
For family or business visits, an invitation letter is generally expected instead of a hotel booking, especially if you will stay with a host or attend meetings.
When both may apply
Providing both is not usually necessary unless your travel plans involve a mix of arrangements. In that case, documents should clearly explain where you will stay at different stages of your trip.