The U.S. Department of Education says that federal student loans are "discharged" or forgiven at death. Parent PLUS loans are discharged if either the student or the parent borrower passes away. But it is not automatic; a process needs to be followed.
The servicer of the loan must be sent a copy of the death certificate. It begins processing the loan discharge unless there is a co-signer on the loan. In a few days or weeks, the Dept of Education approves a write-off of the account. Any payments received after the date of death are refunded.
But for private loans, in most cases, there is no such luck. The private loans are not forgiven, and the private student loan lenders can seek collection from the borrower's estate, if there is one. Or, if there is a co-signer, they will likely pursue collection from the co-signer.
There have been reported cases where private lenders make exceptions, but they are not usually legally required to do so. If this is your situation, you can send them a copy of the death certificate and request that they write off the loan.