What happens to your Yahoo email account when you die depends on a few things, including:
The surest way to know what will happen to your Yahoo email account is to make a plan and leave any necessary instructions to the people who will be wrapping up your estate.
If you want someone to access to your yahoo email, leave instructions about 1) how to log in to the account and 2) what to do with it. Yahoo's Terms of Service (TOS) -- that you agreed to when you signed up for your account -- state that when you die, Yahoo will terminate your account and delete your data. So, giving someone else your user name and password will only work as long as Yahoo thinks you are alive. Practically speaking however, it is the only useful way to give someone else access to your account.
If you want to keep your account private, you can make a plan for that too. You can:
Yahoo does not currently allow you to decide what should happen to your account when you die, but it might someday. Tech companies are recognizing that users might not want their accounts deleted, and some are providing tools that allow account holders to decide the fate of their accounts. For example, Google's Inactive Account Manager allows account holders to decide whether to delete the account or pass (some) account information on to survivors after a period of inactivity. Keep an eye out for Yahoo to provide a similar tool.
If you don't make a plan for your Yahoo account (and no one hacks into it), your account will be deleted after 12 months of inactivity. If you do not want anyone to have access to your email account, and if you expect that no one will try to access your account, this "do nothing" approach could work well.
However, doing nothing will likely have an undesirable outcome if you want to either 1) provide access to your account, or 2) really make sure that the account remains private. On one hand, unless you leave instructions, the person wrapping up your estate (your executor) will have a very difficult time accessing your account. On the other hand, in some states, your executor may be able to get access even if that's not what you want.
Yahoo is clear that it will not give your executor – or anyone else -- access to your account unless it is legally obligated to do so. Until recently, those legal obligations have been few and far between. However, the law is changing and, in theory, your executor's ability to access your account could vary by state.
Most states do not have any laws that grant executors access to a deceased person's email account. In these states, Yahoo will delete your account when it learns of your death and no one will be able to access your account unless you leave instructions or your someone manages to break in.
However, a few states have passed laws that grant executors authority to access digital accounts, and many more are considering such laws. These laws require "account custodians" like Yahoo to provide access to executors. These are new and untested laws, and you can expect Yahoo will do everything it can not to grant access to your executor, even in the states where the law requires it to do so. It remains to be seen what will happen in this unsettled area of law. Only time will tell whether tech companies like Yahoo will be required to provide access to a deceased person's account.
You can learn more about this, including information about your state's law on Nolo's Digital Assets page.
If you do not make a plan, after your death your Yahoo email account will probably continue to exist for 12 months and then Yahoo will delete it. Depending on your state, your executor may have a slim chance to gain authority over your account, but it will be a struggle.
If you want to control what happens to your account, either plan for it to be deleted, or tell your loved ones how to log into it and what to do with it when they get in.