dataGridView1.Rows[i].Cells[txtColumnName.Text.Replace(" ", "")].Value = Time.ToString("HH:mm:ss");
For Rows[i], "i" probably refers to a row that doesn't exist. Eg you have 4 rows and i is 7. i is a loop on column.Length so you probably don't mean to use it for the row count as well, did you mean Rows[RowCount] instead?
As Griff said, we can't run your code or know your logic, only you can know that so get used to debugging your own code
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]