It depends on your starting point and how much time you are willing to dedicate to learning.
If you are already familiar with basic programming concepts and have a strong math foundation, you may complete a comprehensive DSA course in as little as three months. However, if you are starting from scratch, it will likely take longer.
No matter how much time you dedicate to learning, the most important thing is to focus on understanding the core concepts of data structures and algorithms.
Once you have a strong understanding of the basics, you can move on to more complex topics at your own pace.