The best time to dethatch your lawn depends on a couple of factors, such as the type of grass you have and the current state of your lawn.
The most important thing to understand about when to dethatch your lawn is that it should be done during the period when your lawn is growing most vigorously, because it needs time to recover from the dethatching process.
Ultimately, the best time to dethatch your lawn is when the grass is actively growing and the weather is not too hot or too cold. This will give the grass the best chance to recover from the dethatching process.
With these factors in mind, let's discuss when you should dethatch your lawn.
What Type of Grass Do You Have?

Looking for thatch
Cool-Season Grasses
If you have cool-season grass (Kentucky bluegrass, perennial ryegrass, fine fescue, tall fescue), the best time to dethatch is in early fall.
Dethatching in the fall allows the grass to recover from the summer heat and stress and to prepare for winter.
Dethatching involves aggressive raking, which can damage a lawn, and your grass needs time to recover.
Generally, grass needs about a month and a half of favorable growing conditions to recover completely. And cool-season grasses stop growing in the summer, so dethatching in the spring might not give it enough to regrow.
Another benefit of dethatching cool-season grasses in the early fall is weed prevention: weeds are less prone to sprouting in the winter than in the spring.
Warm-Season Grasses
If you have warm-season grass (bahia grass, bermuda grass, centipede grass, St. Augustine grass, and zoysia grass), the best time to dethatch is late spring or early summer.
This is when these grass types are going through their annual growth spurts, allowing them to quickly recover.
The reason you don't want to dethatch warm-season grasses in the fall is because it doesn't allow the grass enough time to recover before entering the winter dormant season.
Dethatching in the spring gives the grass a chance to recover from any winter damage and to start the growing season with a fresh, clean slate.
What's The Temperature Outside?
You should also keep in mind the overall outside temperature when dethatching your lawn.
You don't want to dethatch when it is too hot, or too cold. Too hot, and the grass risks going into shock and dying. Too cold, and the grass may not have a chance to recover before winter.
You should never dethatch your lawn when it's stressed or dormant, as you can damage it beyond repair.
What Condition Is Your Lawn In?
A strong, rigorous lawn can handle the dethatching process much more successfully than a weak, dying lawn.

Is your lawn generally in good shape? If it's already in good condition, with a strong root system, it will be able to withstand the stress of dethatching better than a lawn that's weak and in poor condition.
If your lawn is in poor condition, we would recommend holding off on dethatching and waiting until it's in better shape.
Generally speaking, you shouldn't have to dethatch your lawn more than once a year. And you shouldn't dethatch after it rains or if your lawn is overly wet.
What Is Thatch?

Looking for thatch
Thatch is a layer of organic matter (dead grass clippings, roots, etc.) that sits between the grass and the soil, building up over time, that can reduce the vigor of your lawn.
Excess thatch can prevent water, fertilizer, and other nutrients from getting to the grassroots, while also providing a comfortable home for pests and diseases to thrive.
If you have a thatch problem, you may notice your lawn is spongy when you walk on it, or yellow or brown patches where the grass is thin or dying. You may also see weeds or bare spots. Not good!
On the other hand, a thin thatch layer (less than 1 inch) can actually be beneficial to your lawn, and if you have a thin layer, there's no need to remove it.
Reasons You Should Dethatch Your Lawn
Do you really need to dethatch your lawn? Here are some reasons why you should get rid of a thick thatch layer.
It can increase the amount of water and fertilization. The dethatching process allows air, water, and fertilizer to penetrate the soil more easily, promoting healthy lawn growth, which in turns makes your grass look that much better.
It can make your grass "stand" up straight. We all want a lawn where the grass is sticking straight up. Not only does it look cool, but it makes for better cuts as well. When you dethatch your lawn, it helps to get the grass to stand up straight.
It gets rid of all the "crap" in your yard. Besides the "health" benefits that dethatching provides, it also makes your lawn cleaner, simply by removing any twigs, debris, and pine needles that are in the way. All of that junk makes for an ugly-looking lawn.
For a fuller picture on the pros and cons of dethatching, see here.
And here are some tips on what you should do with the thatch when you're done dethatching.