Its the walls pre-painted condition that dictates how much prep work is required. Drywall cracks and nail holes need to be repaired. The ever more popular decorative stickers need to be removed and the glue cleaned off so that the new paint will stick.
Sometimes the old paint has started to give off a chalky powder. In many cases this means washing of the walls before any paint can be applied.
The new paint color that is going over the old can require a primer coat. All drywall repairs must be primed, all water stains or heavily stained areas must be primed as well. See the post What Does Primer Do for more.
Finally any gaps that need caulking should be address during the prep stage.
Depending on what needs done a proper prep job may last one to four days. (A drywall repair usually takes three to four days.)