China has set a goal of landing Chinese astronauts on the moon for the first time by 2030.
For Pakistan, which does not have its own spacecraft to send astronauts into space, the invitation is significant.
Beijing said it hopes the flight will strengthen ties with Islamabad as the two countries mark 75 years of co-operation in space.
The Shenzhou-24 mission is also a diplomatic moment for Beijing.
China has poured billions of dollars into its space programme, and its Tiangong space station is run by teams of three astronauts that are typically rotated every six months.
Ali will return to Earth after a short stay, with two Chinese crew members who have been at the station since May.
While in space, the Shenzhou-24 crew will carry out experiments and test technology.
The work covers the effects of space on living organisms, aerospace medicine, and combustion.
Ali will conduct studies on photosynthesis in bacteria and on the effects of radiation and microgravity on seeds.
Microgravity is the very weak gravity found in space.
The crew will also study how the space environment affects aging, with the hope of developing new ways to prevent and treat age-related vascular diseases.
Zhu has been studying how the human body adapts to long periods in space.
China is now keen to show that Tiangong has the potential to become an international research platform rather than an exclusive Chinese facility.
The flight comes as Beijing tries to establish itself as a major alternative to the US-led space programme.