How to make an effect last for only a certain amount of time
The correct way to do this is to animate the effect. Whatever effect values you are altering, those need to be set to zero or null result value 1 frame before your intended start time. In the next frame set it to the desired value for the effect. Set a key for the desired value at the last frame of your intended range. Then set a key for the zero/null value the next frame.

The crude way to do this is to split the layer at the start frame and end frame Ctrl+Shift+D. And remove/disable the effect on the layers outside the effect range.