How to apply gradient colour along a curve?
Depending on the way your mesh was made, it may or may not have an automatically generated UV map. As @ Master Heavy has commented, if it does, you can use a shader tree like this:



using either X or Y, depending on which dimension of your subdivided plane is the long one.

If the plane does not yet have suitable UVs, then you will have to unwrap it. That may be a supplement to your question .. perhaps the best way to get a clean answer to that would be to share your file on Blend Exchange.