If you are using In-Proc Session Mode, in that case you can get Session Timeout Event in the global.asax file. So if you are creating Cookies and other user specific stubs , you can clean those thing using this event.
In Global.asax.cs
protected void Session_End(object sender, EventArgs e)
{
//Clean-up Code
}
In case of Out-Proc Mode you will never get Session timeout event.
As Tommy said that there is no fool proof way to determine if someone closed a browser, But you can do it by Jquery. You need to ping your server at specific time intervals. So when you stop getting anything from the client after specific time duration , you can perform cleaning operation (Same like session timeout)