The settings for the terminal window buffer size can be found in the IntelliJ registry.
You can find the registry through ctrl+shift+A and type Reg (or from the menu Help->Find Action…). You should see Registry… Click that.
Scroll down the registry and search for terminal.buffer.max.lines.count (you can also start typing ‘term’, it will take you there). It is set to 1000 lines out of the box, set it to what ever size suits you…
UPDATE FOR LATER VERSIONS OF Intellij
You can change the terminal scrollback buffer size here:
File » Settings » Advanced Settings » Terminal
You have to scroll down quite a way on the Advanced Settings page to get to Terminal but you should see Terminal scrollback buffer size: