Allah says in the Holy Quran: Bow down with those who bow down.
Hadith says: salaat with jamaat has 27 times more reward than salaat alone.
The Holy Prophet (sallallahu alaihi wasallam) was constant his entire life in praying his salaat with jamaat. It wasn’t until the last few days of his (sallallahu alaihi wasallam) life when he was very sick that he gave up the jamaat.
Likewise the sahaba were the same way, meaning they never gave up the jamaat. They looked upon someone who missed jamaat as a hypocrite. The never missed the jamaat unless they had an excuse or they were travelling.
It is narrated by Abdullah ibn masood (ra) that:
“We saw that only the hypocrites left the jamaat and by doing so we considered that person to be a hypocrite. Or those people who were sick. Verily a sick person would come walking to the masjid in-between two others who would help carrying him. And he said: verily the Holy Prophet (sallallahu alaihi wasallam) taught us the sunnah and right guidance, and among the sunnah and right guidance is salaat in the masjid which there was an azan.
Jamaat is the gathering of people for the purpose of praying together and it consists of an imam and a certain number of followers.
For the five times a day salaats it is enough to have just one person behind the imam to make a valid jamaat.
For the Friday prayer three people are necessary to pray behind the imam for the salaat to be valid.
To pray in jamaat is sunnah muakkadah for men and it is close to wajib. It is not permissible to leave the jamaat except if you have a valid sharia excuse. If you don’t have a valid excuse then you will be sinning. It is a condition for the validity of the eid namaaz and the Friday jumuah namaaz that they are performed in jamaat. Both the Friday prayer and the eid prayers will not accepted unless they are prayed in jamaat.
It is also sunnah muakkadah to pray the tarawih namaaz in ramadhan in jamaat along with the witr namaaz.
Outside of ramadhan it is makrooh to pray witr in jamaat.
It is makrooh to pray the lunar eclipse in jamaat.
It is makrooh to pray nafl in jamaat when you make an announcement or call the people to this namaaz. If people happen to gather together without announcing or preplanning then it would be jaiz.
It is makrooh to pray a second jamaat in a neighbourhood masjid that has an imam and muazzin and they have already prayed the same namaaz by calling the azan and iqamat. It would be permissible to pray a second jamaat at a different location than the first.