You can turn an effect on or off by adding a mask to the layer, setting the Compositing options to use the mask, then animate the mask opacity. For example, I added Black and White and Brush Strokes to this clip with a Subtract mask in the middle, set the mask to subtract, added it to the Compositing Options for both effects, then animated mask opacity from zero to 100%. The result is a normal clip that changes to black and white + brush strokes outside the mask as the opacity changes.
There is any number of ways to control how effects are applied and for how long from simple layer splitting to using internal effects controls to control intensities to the already mentioned compositing controls. You have to be much more specific for a concrete answer. Generic "Can I do this and that?" usually questions don't go anywhere. I would also strongly suggest you actualyl start by reading the online help on some basics.
When you're getting started, i think the simplest way to control how long you want an effect to be applied is to duplicate the video layer with the effect on, and keyframe it's opacity to fade it on and off. You could also trim the clips in the timeline. There are multiple other ways to do this, but this is probably the most visual way to see what's happening in the timeline.
For me, the easiest way is to change the Effect Opacity property on the Timeline panel. You can stop it abruptly or create a smooth fading. Later you can learn how to animate it with expressions and a great new experience 🙂
Here the effect is stopped quickly using the Opacity changing from 100 to 0 in the adjacent frames.