I'm going to buy the Playstation 5 and would like to know whether a 24 inch monitor is enough with 144hz or a 27 inch would be better, otherwise I always play on a 27 inch television with 60hz.
So
Inches is the diagonal size.
Your choice of size and resolution should depend on how far you are from your screen and where the screen is positioned and then what is most comfortable for you. Whether 144 Hz or 60 Hz does not matter in the choice of size.
Personally, I would only use screens with 24-27 inches for gaming.
At HZ I would take anything over or exactly 144HZ.
To get back to your question, 24 inches are enough for me, but you have to know whether you prefer 27 inches.