I like to chime in on these "practice habits" threads because this is such an important thing.
There's a long standing wisdom that was mentioned before about practicing mistakes. It is true that the first several times you play something are by far the most important. They set the stage for your ability to play it correctly down the road.
You absolutely must practice slowly and carefully many times over. The motions need to be correct and your brain needs to have time to assimilate that and put it all together.
But here is where most posts end and I'm just getting to what I feel is the most important part...
One of my hobbies is bicycling. Before my son was born it was not uncommon for me to go out and ride for several hours at a time. I have attempted one of the 10 hardest mountain bike rides in north america 3 times. I haven't yet finished it because I can't quite do it fast enough. So we're talking serious cycling.
What's that got to do with guitar playing you ask? The best way to build endurance for those long rides is to ride slow, not pushing yourself too hard, for long periods of time. That's basically the same as playing a piece of music slowly. You go slowly and deliberately and don't make any mistakes.
But on the bike, if all you do is ride slow, you get really good at riding slow! And that's NOT the goal of all of those training rides.
If you don't leave your comfort zone and push yourself once or twice a week, only for a few minutes, you don't build that next level. Similarly when you practice, if you play something 20 times slowly, then play it 2 or 3 times at full speed. Are you going to butcher it? Probably. But that's okay, it builds your finger speed, and over time it'll get there.
If all you do is practice slowly, you'll get really good at playing that piece of music slowly. Again, not what we want here. The speed will not quite come all on its own, you have to ask for it... not often, but you have to do that.
I've seen this technique work time and again with my students. Try it for yourself and you'll see.
Griff