First of all here is the
link to the docs for the Task Parallel library. This would be a good place to start with such a very generic question. You should probably examine using a threadpool and setting the maximum threads in the thread pool.
int workerThreads, completionPortThreads;
ThreadPool.GetMaxThreads(out workerThreads, out completionPortThreads);
workerThreads = 32;
ThreadPool.SetMaxThreads(workerThreads, completionPortThreads);
Without any details of what you're trying to accomplish, what coding language you're using, what code framework you're using, it's going to just about be impossible to provide any kind of meaningful answer.