What you describe is a well-known phenomenon in second language acquisition theory and goes by the name of interlanguage fossilization. If it is only temporary, the period of stagnation is also known as a plateau period.
Why the term "interlanguage" in "interlanguage fossilization"? Some theories of second language acquisition describe the incomplete knowledge of a foreign language as "interlanguage" because you start from your native language and gradually move to the foreign language. Each transition phase between the native language and the foreign language is a mostly consistent "interlanguage". When you stop making progress, this interlanguage becomes "fossilized". Since many people learn a foreign language only up to the level that helps them get by (I consider passing tests and exams at school also as a form of "getting by"), interlanguage fossilization is quite normal.
People have suggested all sorts of ways to get over a plateau.
Donovan Nagel at the Mezzofanti Guild makes an analogy with weight training and advocates the "shocking principle": do exercises that your mind (or body – in the case of weight training) is not used to. He also suggests setting very specific microgoals. (A macrogoald would be something like " I want to pass a B2 French exam before the end of the year", and microgoals would be steps that take you closer to that goal.)
Noel Van Vliet has a long article about overcoming a plateau. He says that you need to get out of your comfort zone (a suggestion similar to Donovan Nagel's shocking principle), that you should gradually move to learning materials in your target language, that you should analyze your weaknesses and then work on them by using "mini goals", and that you should write more. (Noel Van Vliet gives several examples of mini goals, e.g. learning 100 new words in two weeks.)
For other articles, see Language Hacking: Breaking out of the Intermediate Plateau by Robert William McCaul, and 5 Innovative Tips for Language Learners Stuck on the Plateau Phase by Brian Powers.