What happens when a lease is up
You drive the car to the dealer and hand them the keys and walk out the door if your under the required mileage and have no damages. If you have damages to the vehicle and over the stated mileage in the lease, you will incur some addition costs that should be spelled out in the lease you signed.
OK so what are the options on keeping that car
You can offer to purchase the car at the current value as stated by the dealer. You already paid the depreciation as part of the lease. Cash or apply for a loan at current interest rates for used cars.
Some leasing companies will actually come to you for the inspection at lease end. Then they will pick up the car. As Tom said, sometimes you take the car to the dealership at lease end. It all depends on the leasing company. Usually the lease contracts lists what you would have to pay for the car if you wish to purchase it.