Under the bill, the armies of the two countries will also be able to carry out joint exercises, which are according to Turkey aimed at promoting regional peace.
Turkey's parliament on Wednesday ratified two deals on deploying troops in Qatar and training the Gulf nation's gendarmerie forces.
The votes came just days after five Arab countries cut ties with Qatar.
The deal on deploying troops on Qatari soil to improve the country's army and boost military cooperation was signed in April 2016, in the Gulf country's capital Doha.
Under the bill, the armies of the two countries will also be able to carry out joint exercises. The move aims to contribute to regional and world peace.
In addition, the Turkish gendarmerie will be able to train Qatar's gendarmerie forces under a deal between the two countries' interior ministries signed in December 2015.
On Monday, five Arab countries — Saudi Arabia, Egypt, the United Arab Emirates, Bahrain and Yemen — cut ties with Qatar, accusing Doha of supporting terrorism.
Qatar denied the accusations, calling the move "unjustified".
The escalation came two weeks after the website of Qatar's official news agency was allegedly hacked by unknown individuals who reportedly published statements attributed to the country's Emir, Sheikh Tamim bin Hamad al-Thani.
The incident triggered a diplomatic row between Qatar and its neighbours.
Earlier, Turkish President Recep Tayyip Erdogan said that isolating Qatar, including through the use of sanctions, would not resolve the rift.
"It will not contribute to solving any problem to try and isolate Qatar, which we know for sure has fought very effectively against terrorist groups," he said on Tuesday following a dinner. Erdogan said Ankara will do everything in its power to help end the crisis.
Turkey set up a military base in Qatar, its first such installation in the Middle East, under an agreement signed in 2014.
In an interview in late 2015, Ahmet Demirok, Turkey's ambassador to Qatar at the time, said 3,000 ground troops would eventually be deployed at the base, planned to serve primarily as a venue for joint training exercises.
Turkish exporters have expressed their willingness to meet Qatar's food and water supplies to stave off possible shortages after its biggest suppliers, including Saudi Arabia, cut ties, the head of Turkey's main exporting trade body said on Wednesday.
Mehmet Buyukeksi, chairman of the Turkish Exporters Assembly (TIM), said exporters stood ready to fill the gap after the United Arab Emirates (UAE) and Saudi Arabia cut trade ties with Qatar.
A government official in Qatar earlier said Doha was talking to Iran and Turkey about securing food and water supplies.
Iranian minister visits Turkey amid Qatar row
Iranian Foreign Minister Mohammad Javad Zarif arrived in Turkey on Wednesday to discuss, among other issues, the Gulf diplomatic crisis with the Turkish leadership.
Speaking to reporters at the entrance of his hotel in the capital Ankara, Iran was facing "concerning developments" in the region and added: "We need to have close exchange of views with Turkey about these incidents."
Zarif also commented on Wednesday's deadly twin attacks in Tehran and said: "This attack will further consolidate our people's stance against terrorism."