Hello Denis!
As the matter of fact I spoke about this topic last night with jafomatic in chat.
IMO both ways are fine, you can simply learn whole song or solo note by note,
play it slow and build up the speed for entire thing,
or you can practice separate parts.
Depends of how complex is the song or solo that you wanna play,
perhaps you'll end up by even mixing these 2 approaches a bit
but it doesn't matter as long as you keep things clean.
Perhaps 2nd way of learning might be used more often
cause most of the things we play don't demand same technique level all the time,
there are easier parts and then some fast run etc.
So you can learn easier parts fully, play them slowly (not too slow)
just to understand all timing
and then push them up the tempo but you'll have to repeat faster runs
more and more until you fix all the issues, timing, technique etc.
Main thing is NOT to play too fast right from the start
or else you'd most likely play many parts sloppy,
and you have to be ready to judge yourself hardly but be objective,
listen to how it sounds, is it tight enough, clean enough...
It's not so black and white, there are many ways to accomplish certain goal
but discipline is a must, record yourself and listen to how it sounds,
judge yourself and ask someone else to judge you as well
if you're not sure 100% of overall result.
After a while (how long, it depends on you)
you'll set higher standards and you'll be able
to figure out what parts or licks you need to slow down
and spend more time with.
We all love to get to full time as soon as possible
but it would be wrong to play sloppy at the end.
When to push tempo up?
Push tempo up when you can play it correctly.
For extreme fast section you can even push tempo
a bit before just to see how your muscles would react,
don't do it for too long tho and go back to your "top" speed,
spend more time there and then again push up slowly.
Cheers