Booking online is your best friend here 👍 go to the ePassos website (epassos.sef.pt) and you can schedule a specific date at a police station of your choice. You don't need to go in person to book - it's all done right there. Then you just go on the scheduled day with the necessary documents (ID card, current passport, and proof of payment for the fee).
The timeframe really depends on when you're doing it, but if you book now for August/September you've got a decent chance of having everything ready before your trip. Most police stations can process it in less than a week if you book in advance, especially if you don't go during peak hours. What helps a lot is going early in the morning when they open 😄
One hack that a lot of people don't know about: if your local police station is swamped, it's worth calling ahead and asking which one in the area is the least busy. Sometimes a police station 10-15 km away has availability for the following week while yours is booked solid months ahead. Also sometimes bookings get cancelled - it's worth checking ePassos once in a while to see if earlier slots pop up.