I will be travelling to UK next week and I want to invite my parents. So can I send invitation letter immediately within a week. I will be staying in apartment with three months of agreement. But somebody told me to send invitation letter you must at least spend three months in UK. It won't be possible for them to join in winter so they will go back in October
If your parents can afford to pay for their own travel, it is better for them to present themselves as independent people with a social and economic life in their own country, not your dependents. In that case, there is no need for you to provide any letter. They can apply for visitor visas. They will need a history of bank statements in their home country to show they can afford the travel.
Whether they will be able to get visas depends on the nature and extent of their ties to their home, such as other relatives who are not traveling with them, jobs, property, or a business. The fact that you say they need to return by a specific time is encouraging. Any commitment that limits how long they can stay in the UK is good.