Until you can play a certain piece well depends on several factors:
- Difficulty of the piece
- Quality of practice (deliberate and efficient practice)
- Quantity of practice (practice hours spent)
- Grit (willingness to do hard, focused work)
If we take the complete 1st movement of Beethoven’s Moonlight Sonata as an example and claim to play this piece musical and accurate then you will probably have to practice the piano for several hundred (!) hours, depending on your musical disposition.
If you start from zero without any prior knowledge, mind you.
Ultimately, what counts is the number of kilometers you cover on your way.
You must not forget how complex playing the piano is. It takes many years or thousands of hours to develop and refine movement, coordination and musical thinking among many other aspects.
In addition, even intermediate piano pieces are so complex and extensive that a few years of experience are not always sufficient.
You should discuss this with your piano teacher as to when a particular piece makes sense.
If the piece is manageable soon, then you’re motivated to work towards that goal.