Asking for recommendation letters can be tricky, especially figuring out when to do it. Ideally, you should approach your recommenders at least a month before your application deadlines. Give them plenty of time to write something thoughtful.
Also, consider timing it around key academic moments, like right after a strong exam or project. This way, they can mention your recent successes explicitly, which makes the letter more compelling!