My Chemistry teacher told me that screening effect is the ability of the atom to prevent the valence electrons from being pulled towards the nucleus. The screening effect depends only on the number of electron orbits inside the valence shell. For example, the atoms across Period 3 have 3 shells occupied by electrons. So, the screening effect remains unchanged.

But I thought that when going across Period 3 from left to right, the number of electrons increases and so does the electrostatic force. This causes the valence shells to be pulled closer to the nucleus. So, my opinion is, the ability of the atoms to prevent the valence shells from being pulled towards the nucleus would decrease. Thus, the screening effect should also decrease. Is my opinion right?

Your teacher oversimplified that explanation. The screening effect is due to the repulsion by other electrons. Each new electron that is pulled on by the positive charge of the nucleus is repelled by the electrons that are already there – making it keep its distance so to speak. Thus, electrons in higher orbital are further removed, each new shell introducing more electrons to repel the next shell. As distance increases, the electrostatic force of attraction between nucleus and outer shell electrons decreases thus valence electrons are the ones that participate in reactions. Your theory probably would have been correct if all electrons were clumped together creating greater charge (as is in case of the protons in the nucleus), the electrons, however, have to be taken separately one by one.

I am not sure what you mean by “screening effect remains unchanged”, so I am not sure that I answered your question completely.

So, in Period 3, how is the pattern of the screening effect of the elements when going across the period from left to right? By the way, is screening effect a measurable quantity or is it just a property of elements?

Let's start from the beginning. Screening effect or shielding effect is the measurable or rather calculated quantity of the part of the nuclear attraction force that is negated by electron repulsion or repulsion of outer electrons by inner electrons. So outer electrons experience less attraction toward the nucleus than inner electron, thus, increasing distance and keeping electron shells in predictable order.

I misunderstood your question at first. You are confusing shells and atomic radius. In each period if you go from left to right, the overall radius decreases due to increased nuclear charge (Z) and therefore increased effective nuclear charge (electron from the same shell do not contribute to shielding each other). The electron shells remain in the same order due to the shielding effect.

Z (effective)= Z (actual) - electron shielding

So, to answer your question:

In period 3 from left to right you have increase in Z (actual) and the same electron shielding. The result is increased Z (effective) and decreased radii of the atoms - as you said before - the valence shell is pulled closer.

If you go from the 1st period to the last in the same group, you would observe the increase in the radius due to the shielding effect increase with each new electron shell.