The answer depends on the book’s genre.
A children’s first reader needs to be short - very short and less than 500 words.
In general a publisher won’t bother with an adult book of fewer than 40,000 words since it would be too expensive to set up a print run. Even then it would be restricted to YA or romance genres and 60,000 words would be preferred.
Romance is typically 60,000 - 80,000 words
An average book in other genres would be about 80,000 words.
Science fiction tends to be longer at 100,000 to 120,000 words
Publishers probably wouldn’t bother with a book of more than 120,000 words since it would be too expensive to edit. They may make exceptions for an author with a proven track record.
Ebooks follow a different rule. It seems people prefer longer ebooks as ‘good value for money.’