This paper studies an intelligent reflecting surface (IRS)-aided downlink ultra-reliable and low-latency communication (URLLC) system, in which an IRS is dedicatedly deployed to assist a base station (BS) to send individual short-packet messages to multiple users. To enhance the URLLC performance, the users are divided into different groups and the messages for users in each group are encoded into a single codeword. By considering the time division multiple access (TDMA) protocol among different groups, our objective is to minimize the total latency for all users subject to their individual reliability requirements, via jointly optimizing the user grouping and block-length allocation at the BS together with the reflective beamforming at the IRS. We solve the latency minimization problem via the alternating optimization, in which the blocklengths and the reflective beamforming are optimized by using the techniques of successive convex approximation (SCA) and semi-definite relaxation (SDR), while the user grouping is updated by K-means and greedy-based methods. Numerical results show that the proposed designs can significantly reduce the communication latency, as compared to various benchmark schemes, which unveil the importance of user grouping and reflective beamforming optimization for exploiting the joint encoding gain and enhancing the worst-case user performance.