Yes Google always see the back links from a quality site,so if you'll get from a .edu or .gov back links it must be an advantage for you.But getting back links from these sites are quite difficult.
It's not necessarily the fact that it's a GOV or EDU TLD, though. Consider the actual pages from other sites that are linking to that GOV or EDU page that then is going to link to you.
In many cases, a GOV or EDU link is going to be a good link to have because they have good links. but not all GOV and EDU links are created equal.
Yes, .edu and .gov backlinks do carry a higher value for search engines. If you are looking to increase your search engine therefore, it could be a good idea to collect some of those backlinks.
edu links are not always a good thing. A few years ago I had a client who was buying sitewide links from stanford.edu and another university. Sanford.edu used to have a section in the lower right column with paid links. When Google started discounting sitewide links, his site went into a tail spin. He had a large AdWords account that was managed by Google, so he asked the rep to check into it. The rep confirmed that his site was hit with a penalty due to linking schemes. It took six months for the site to recover after he stopped buying sitewide links from universities.
A few links from .gov or .edu sites can be a good thing, especially if they are natural links in the text on a page. But it can be obvious that a sitewide link is a paid link and can harm your rankings. In this case, it was the sitewide links and not the fact that it was on an edu site that caused the problem.
I know that the people selling sitewide links will disagree with this, but the penalty in this situation did occur and was confirmed by Google. It was one of the very, very rare cases when Google actually confirmed a penalty.
I agree with bhartzer. Not all gov and edu links are created equal. Ideally, you want a natural link on a page that covers the same topic as that of your page receiving the backlink.
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin
In my opinion .gov links has no more power than .com links, but .gov websites are usually old, well linked and has good authority. It has nothing to do with extension it is you quality of .gov websites...
Follow me on Twitter: @hendricius
If you make a web page that has a tool on it, no Ads and ranks highly on a search engine then you can get a .edu link by chance e.g. a tool to display the number of lions in Africa with a heat map. Then later include Ads for hotels and safaris.
Academics will be searching for tools and info. to link to to support their research, but only if it seems to be purely philanthropic and free of clutter.
Well that's my opinion and based on my thinking about why I got a .edu link to one of my web pages. Not sure how powerful the link was though.
Other ideas would be statistical data in tables that they may want to link to.
For .gov, I think you can ask libraries to list your home page if you are somebody involved in academic research etc.