Your problem is likely because the code that is running to create your change event listener is being run as soon as the document is loaded. I'm guessing you have your table set-up so that it starts with one row. When you add additional rows, the code isn't being re-run to add the change event listener to the new rows, so they don't trigger the same code when changes happen. You could test this by tweaking your table on the Layout page to start with more rows, and see if you code works on those other rows.
I have not fully tested this, but some changes to your code like this, will likely work. This runs your same code at two different times - it does this by putting your code into a custom function and then calling that function multiple times - it calls it when the form is first loaded, and then calls it again any time you add a new row to the table.
$(document).ready(function () {
//Run the function to add the event listener when the form is loaded:
AddMyListener();
//Run the function to add the event listener when the table is changed:
$('.cf-table-add-row').on('click', AddMyListener);
//This is the function to add the event listener:
function AddMyListener()
{
$('#q5 .fileuploader').on('change', function() {
var $row = $(this).closest('tr');
$row.find('td').eq(4).text("");
var filename = $row.closest("tr").find('.fileuploader')[0].value.split('\\').pop();
alert(filename.substr(0, filename.length-4));
var nombre = filename.substr(0, filename.length-4);
$row.find('td').eq(4).val(nombre);
});
}
});