I'm not an expert, but yes, when you disable Wi-Fi, your device will stop scanning for networks and broadcasting your MAC address, so you can no longer be tracked that way. More recently, phones have also started randomising MAC addresses while scanning (starting in iOS 8, I don't know about others), so you can only be tracked for a short time as long as your Wi-Fi is on but not connected.