Replacing a plumbing valve takes between as little as 15 minutes to as long as 1 to 3 hours depending on how complex it is.
Simple plumbing valve replacements such as a ball valve or gate valve can often be replaced within 15 minutes to an hour or so.
Sink or toilet valves can also often be replaced within 15 minutes to 30 minutes.
Although if you hire a plumber you'll often be charged a minimum of an hour charge even if the plumbing valve is replaced in less than that and also a travel charge for the plumbers travel time and to show up.
More complex plumbing valve replacements such as those behind a wall or shoulder valves, a main shut off valve etc could take several hours.
Plumbing valves that are located behind walls or cabinets will take longer to access and replace than valves outside of walls or cabinets.
And some valves such as ones with compression fittings are also easier to replace than valves that have sweat connections also known as soldering.
A corroded or stuck valve can also add to the replacement time and cost.
The more complex the job the more it will cost and the longer it will take.