This is a rate problem and you need to find a common basis for comparing the painters. We know that Painter A paints a house in 3 hours and Painter B paints a house in 5 hours.
To find out how much they can do together per hour, add together what they can do individually per hour: 1/3 + 1/5 = 8/15.
They can do 8/15 of the job per hour. Now let "t" stand for how long they take to do the job together. Then they can do 1/t per hour, so 8/15 = 1/t.
Flip the equation, and you get that t = 15/8.
That's 1 7/8 (1.875) hours.
Painter A and Painter B can complete the job together in just under 2 hours.
Learn how to compute rates associated with ratios of fractions or decimals with KhanAcademy.org's rates with fractions tutorials.