and when is the right time to use textures instead of shaders.also do they effect performace in the same level ?
It's a bit of a hard question to answer because every object needs a shader (diffuse, glossy, principled, etc.) in order to be rendered. There's not really any comparison. If it's a question of just shaders vs. shaders + textures, then just shaders will of course be faster but will not have the detail you probably need.
You might also be asking about the difference between procedural textures and image textures, which is a whole different rabbit hole and something we cover quite a bit in the Fundamentals of Texturing course which comes after this one. In short, complex procedural textures are going to be slower than image textures but can be made to adapt to the geometry of your model in ways that image textures cannot. The other downside of the procedural approach is that it can be harder to make the shapes and patterns you need with just the default texture nodes.