This is a frequently asked question without a good answer.
Most PLC manufacturers can provide a list of memory required for each instruction, and you could theoretically add them up and add the memory needed for data and have a rough estimate of the memory required. By the time you are done with this, though, you could have just written the program and know what you need. That is the course I recommend - buy the programming software, assume a CPU, and write the program. I try not to go over 75% memory utilization, but I did have a project many years ago where there were 2 bytes (yes TWO BYTES) of free memory left over when I was done. The system ran fine, but we upgraded the CPU at the first opportunity!
If you have experience in an industry you can make a SWAG (Scientific Wild A$$ Guess).