What you can learn in a weekend
In two or three days you can confirm whether the pain is real and frequent. Read the subreddits, forums, and review sites where your target buyer already talks, and look for the same complaint repeating. If nobody is complaining about the problem, that is a fast and cheap no, and you just saved yourself months.
The one to two week version
A fuller pass adds two things: five to ten real conversations with the target buyer, and a small demand test. The conversations tell you whether people will change their behaviour. The demand test, usually a landing page with a clear call to action, tells you whether they will act, not just nod politely.
What makes it take longer
B2B ideas take longer because reaching the buyer is slower and the sales cycle is real. Regulated or enterprise ideas take longer still. If your idea needs a hard-to-reach buyer, budget more time for outreach, not more time for building.