The rate of production increases with building level.
The mine can only hold 3 hours worth of production. You should tap the Stone symbol to transfer the Mined Stone to the Stone Storage.
Stones can be readily won in sieges so it is not critical to upgrade the Mine.
However, Stone Storage must be upgraded before upgrading the Castle.