A balanced team formation method is described for tasks with deadlines in multi-agent systems. With the advances that have been made in computer and network technologies, tasks that are achieved by multiple software/hardware entities are often required in many real-world applications. In addition, these tasks are usually required to be done by specified deadlines to avoid a failure of services or to provide quality services in a timely manner. We designed a method for effective team formation for cooperative work of different entities, called agents, to execute tasks having deadlines. The feature of our method is that rational agents autonomously learn which team they should join and which agents they should work with in order to improve the received rewards. Agents using the method also tried to select teams consisting of agents comparable with themselves; this can help them avoid binding to their teams unnecessarily. Another feature is that they estimate the duration of task execution to avoid a failure of tasks due to a violation of time requirements. We experimentally show that these three functions mutually affect each other positively and can achieve quite good performance in real-time environments.