Whether or not you are able to return to work depends on how severe your symptoms of heart failure are, and how physically and emotionally stressful your job is. If your symptoms are under good control, and your job is not very physically demanding, you may be able to go back to your regular work duties.
Some people find it more stressful to be away from work. If you do return to work after a period of absence, make sure to pace yourself.
Talk to your health care provider about work. He/she will be able to talk to you more about your specific situation.