Here is a wiki that you should read to learn about writing test classes.
You would also need to bulkify your trigger as this could hit the governor limits http://wiki.developerforce.com/page/Best_Practice%3A_Bulkify_Your_Code
You can also see an example of test class here
As for your test class
In your test class you need to run this trigger you have written. As your trigger is fired on update of opportunity and it uses data from Contact role which in turn uses contact.
You need to first create these records in your test class.
Account a = new Account;
a.Name = 'testing in test method';
Contact newContact = new Contact(Lastname='testLastName', AccountId = a.Id, LeadSource='Cold call');
Opportunity o = new Opportunity(AccountId = a. Id, stagename='Meeting', ...);
OpportunityContactRole ocr = new OpportunityContactRole(OpportunityId = o.Id, ContactId = newContact.Id, ...);
Now we have the test records ready. Lets fire the trigger. Trigger gets fired during a DML operation. In your case its on update.
So do an update on the opportunity record
o.stagename = 'Closed/Won';
These should have fired your trigger. Now you can check if the opportunity has been updated with name from contactrole using the system.assert statements.
Asserts that the specified condition is true. If it is not, a fatal error is returned that causes code execution to halt.
assertEquals(Object, Object, Object)
Asserts that the first two arguments are the same. If they are not, a fatal error is returned that causes code execution to halt.
assertNotEquals(Object, Object, Object)
Asserts that the first two arguments are different. If they are the same, a fatal error is returned that causes code execution to halt.