The ANZAC landings took the Ottomans somewhat by surprise. In particular, the terrain just inland from Anzac Cove is uninviting - very rugged and difficult to advance in. If there was a landing in the area, the Ottomans expected it at Gaba Tepe, which is in fact where the ANZAC landing was meant to take place. The actual landing took place about 1.5km further north, and resulted in confusion since the terrain didn't match their orders and maps. Since no landing was expected there, only about 500 Ottoman soldiers were in the vicinity to oppose the 8,000 ANZACs who were ashore by 8am.
The key to the area was Chunuk Bair, the peak dominating the area (nearby Hill 971 was higher, but Anzac Cove wasn't visible from it). Who held Chunuk Bair would have the advantage of superior position and observation. Mustafa Kemal recognised the importance of Chunuk Bair, and when a battalion was requested to help the scant defenders who were unable to stand before the ANZAC numbers, he promptly sent a regiment and a battery. The reinforcements arrived - with Kemal as the man on the spot with them - as the Australians were advancing up the slope. Kemal rallied the fleeing defenders, and was soon joined by a second regiment. The Australians were pushed back, and Chunuk Bair remained in Ottoman hands as the keystone of the defence against the ANZACs. It is fair to say that Kemal's prompt and vigorous action to defend Chunuk Bair kept it in Ottoman hands. Whether the loss of Chunuk Bair would have led to the loss of Gallipoli isn't clear, but it certainly would have made the Ottoman defence more difficult.
The August offensive had Chunuk Bair as a key objective. A New Zealand push to capture Chunuk Bair failed to take it before significant reinforcements were sent by the Ottomans (by a quick-acting and decisive Mustafa Kemal, now commander of the 19th Division). They spent the 7th of August just short of the summit and captured the summit that night, with little opposition thanks to very effective naval gunfire support. However, Kemal put in a prompt counter-attack at 5am, and the end of the day saw the summit shared by Ottomans and New Zealanders. The Wellington Battalion, the first attackers on the summit, suffered over 90% casualties, and was relieved. The two British battalions with them also took heavy casualties, the Gloucesters losing all of their officers. On the morning of the 10th, the British battalions that had taken over the defence from their tattered ANZAC and British predecessors were pushed off the summit by a large Ottoman attack, and Chunuk Bair was back in Ottoman hands, and would remain so. For a second time, Mustafa Kemal was the saviour of Chunuk Bair - the Ottoman command, apart from Kemal, did not expect an attempt to capture Chunuk Bair, and paid little heed to its defence. Before the reinforcements sent by Kemal on the 7th, the defenders were down to about 20 men. Kemal's prompt reinforcement, and vigorous counterattacks, were responsible for the Ottomans regaining Chunuk Bair.
TLDR: Yes, Mustafa Kemal's leadership was decisive. His quick action twice kept the key geographical feature in the area (Chunuk Bair) in Ottoman hands.