Mahalaya is celebrated at the end of Shradh or Pitru Paksha, a 16-day period when Hindus pay homage to their ancestors.