A question I get a lot is how many of a specific item that you are selling profitably you should craft at the time. This is a question that does not have one easy answer, but we will explore the main areas you need to consider.
The goal when crafting
To be optimal you want to craft enough items that you will be able to keep the item posted consistently on the auction house until the next time you have time to craft it. Say you only have time to craft on Saturdays. Then you want to craft at least the number you usually sell in a given week.
The other factor is of course that generally speaking longer crafting sessions are more time efficient. You can click create all and do something else for a few minutes, including laundry, cooking or other things outside of the game, giving you a way to utilize this time for goldmaking.
Personally I prefer to keep more than I sell in a week in stock, but it depends on how much inventory space is required, how much gold I have on that realm and how often I repost.
The optimal restocking amount problem
There are several factors that will constrain you when restocking. The amount of gold you have available limits the amount of materials you can buy and thus the amount of items you can craft. Your inventory space will eventually become a time limit as the many trips to and fro the mailbox will eventually eat into what time you have available for crafting.
It is also generally better to have 4 different items than 4 of the same item, as different items cater to different players which significantly increases your sales on a per day basis. So you want to craft as many different items as possible to increase the total value you have for sale on the AH.
So how do you decide?
You start by going up to one each, or one stack each for consumables, of the relevant profitable items. Then once something sells you can craft 2 of that item. Then you just increase it for every item that sells out until it no longer sells out in a day. Then you are at the roughly optimal level.
For some items that sell very quickly I personally just buy as many cheap materials as I can find. Then I process them into the finished item when I have time and mail them all over to my banker. I then post them whenever I do AH scans to always keep them available.
Art not science
There is an art to this. You need to figure out what your time is worth in terms of inventory hassle eventually. Generally though the biggest limiting factor that has an impact is the amount of gold you have available to spend. Make sure you craft as many different items as you can craft, and as many items as you can sell to keep them available for sale!