Usually, the scope permitted for your assignment is stated in the academic regulations for the course/programme – see the description of the individual type of examination.
The number of characters is the total amount of keystrokes in your assignment, i.e. all letters, special characters and spaces.
If the scope permitted for your assignment is 15 pages, for example, note that a page is not just a page. Each degree programme has specific requirements for the number of characters on a standard page.
On many degree programmes, a standard page is 2400 characters. 2400 characters is 40 lines of 60 characters (see also page layout). Note that a page with 2400 characters is a small page.
The maximum number of pages in your assignment (e.g. 15 pages) includes all content and footnotes, but usually not:
the front page
the table of contents
Note that there can be different standards for how to count figures, images, tables, etc. in terms of characters.
Ask your teacher what to include in the scope of the assignment.
Keep within the maximum number of standard pages allowed. Otherwise, your assignment may be rejected, and you will fail the exam.
If you tend to write too many characters in your assignments, you can set up your word processor so that a page on your screen is a standard page. Then you can easily keep track of the number of standard pages you have written.
Don't get frustrated at having produced too much text to begin with. Having to fine-tune and shorten your text and your wordings during the editing phase is a normal part of the writing process.